/*
 * avianProHidendra.java
 *
 * @Author Hidendra < hid.en.dra@hotmail.com >
 *
 * @Date 2009
 *
 * This script is free software. It may not be redistributed or sold without authors permission.
 *
 */

import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import javax.swing.JFrame;
import javax.swing.event.ChangeEvent;

import com.speljohan.rsbot.bot.Bot;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;
import com.speljohan.rsbot.script.Constants;
import com.speljohan.rsbot.script.Script;
import com.speljohan.rsbot.script.Skills;
import com.speljohan.rsbot.script.wrappers.RSCharacter;
import com.speljohan.rsbot.script.wrappers.RSInterface;
import com.speljohan.rsbot.script.wrappers.RSItem;
import com.speljohan.rsbot.script.wrappers.RSItemTile;
import com.speljohan.rsbot.script.wrappers.RSNPC;
import com.speljohan.rsbot.script.wrappers.RSTile;

public class avianProHidendra extends Script implements ServerMessageListener,
		PaintListener {

	public class Config extends JFrame {
		private static final long serialVersionUID = 3407097160517043670L;

		private final avianProHidendra a;

		private boolean cont = false;

		// Variables declaration - do not modify
		private javax.swing.JCheckBox av137;

		private javax.swing.JCheckBox av148;

		private javax.swing.JCheckBox av69;

		private javax.swing.JCheckBox av71;

		private javax.swing.JCheckBox av73;

		private javax.swing.JCheckBox av79;

		private javax.swing.JCheckBox av84;

		private javax.swing.JCheckBox av92;
		private javax.swing.JCheckBox av94;
		private javax.swing.JCheckBox av97;
		private javax.swing.JSlider boltSlider;
		private javax.swing.JButton jButton2;
		private javax.swing.JCheckBox jCheckBox1;
		private javax.swing.JCheckBox jCheckBox10;
		private javax.swing.JCheckBox jCheckBox11;
		private javax.swing.JCheckBox jCheckBox12;
		private javax.swing.JCheckBox jCheckBox13;
		private javax.swing.JCheckBox jCheckBox14;
		private javax.swing.JCheckBox jCheckBox16;
		private javax.swing.JCheckBox jCheckBox17;
		private javax.swing.JCheckBox jCheckBox2;
		private javax.swing.JCheckBox jCheckBox3;
		private javax.swing.JCheckBox jCheckBox4;
		private javax.swing.JCheckBox jCheckBox5;
		private javax.swing.JCheckBox jCheckBox6;
		private javax.swing.JCheckBox jCheckBox7;
		private javax.swing.JCheckBox jCheckBox8;
		private javax.swing.JCheckBox jCheckBox9;
		private javax.swing.JLabel jLabel1;
		private javax.swing.JLabel jLabel10;
		private javax.swing.JLabel jLabel11;
		private javax.swing.JLabel jLabel12;
		private javax.swing.JLabel jLabel13;
		private javax.swing.JLabel jLabel14;
		private javax.swing.JLabel jLabel15;
		private javax.swing.JLabel jLabel16;
		private javax.swing.JLabel jLabel17;
		private javax.swing.JLabel jLabel18;
		private javax.swing.JLabel jLabel19;
		private javax.swing.JLabel jLabel2;
		private javax.swing.JLabel jLabel20;
		private javax.swing.JLabel jLabel21;
		private javax.swing.JLabel jLabel22;
		private javax.swing.JLabel jLabel23;
		private javax.swing.JLabel jLabel24;
		private javax.swing.JLabel jLabel25;
		private javax.swing.JLabel jLabel26;
		private javax.swing.JLabel jLabel27;
		private javax.swing.JLabel jLabel28;
		private javax.swing.JLabel jLabel29;
		private javax.swing.JLabel jLabel3;
		private javax.swing.JLabel jLabel30;
		private javax.swing.JLabel jLabel31;
		private javax.swing.JLabel jLabel32;
		private javax.swing.JLabel jLabel33;
		private javax.swing.JLabel jLabel34;
		private javax.swing.JLabel jLabel35;
		private javax.swing.JLabel jLabel36;
		private javax.swing.JLabel jLabel37;
		private javax.swing.JLabel jLabel38;
		private javax.swing.JLabel jLabel39;
		private javax.swing.JLabel jLabel4;
		private javax.swing.JLabel jLabel40;
		private javax.swing.JLabel jLabel41;
		private javax.swing.JLabel jLabel42;
		private javax.swing.JLabel jLabel43;
		private javax.swing.JLabel jLabel44;
		private javax.swing.JLabel jLabel45;
		private javax.swing.JLabel jLabel46;
		private javax.swing.JLabel jLabel47;
		private javax.swing.JLabel jLabel48;
		private javax.swing.JLabel jLabel49;
		private javax.swing.JLabel jLabel5;
		private javax.swing.JLabel jLabel50;
		private javax.swing.JLabel jLabel51;
		private javax.swing.JLabel jLabel52;
		private javax.swing.JLabel jLabel53;
		private javax.swing.JLabel jLabel54;
		private javax.swing.JLabel jLabel55;
		private javax.swing.JLabel jLabel56;
		private javax.swing.JLabel jLabel57;
		private javax.swing.JLabel jLabel58;
		private javax.swing.JLabel jLabel59;
		private javax.swing.JLabel jLabel6;
		private javax.swing.JLabel jLabel60;
		private javax.swing.JLabel jLabel61;
		private javax.swing.JLabel jLabel62;
		private javax.swing.JLabel jLabel63;
		private javax.swing.JLabel jLabel7;
		private javax.swing.JLabel jLabel8;
		private javax.swing.JLabel jLabel9;
		private javax.swing.JPanel jPanel1;
		private javax.swing.JPanel jPanel2;
		private javax.swing.JPanel jPanel3;
		private javax.swing.JPanel jPanel4;
		private javax.swing.JPanel jPanel5;
		private javax.swing.JPanel jPanel6;
		private javax.swing.JPanel jPanel7;
		private javax.swing.JPanel jPanel8;
		private javax.swing.JPanel jPanel9;
		private javax.swing.JScrollPane jScrollPane1;
		private javax.swing.JScrollPane jScrollPane2;
		private javax.swing.JScrollPane jScrollPane3;
		private javax.swing.JTabbedPane jTabbedPane1;
		private javax.swing.JTextArea jTextArea1;
		private javax.swing.JTextArea jTextArea2;
		private javax.swing.JTextArea jTextArea3;
		private javax.swing.JTextField jTextField1;
		private javax.swing.JTextField jTextField10;
		private javax.swing.JTextField jTextField11;
		private javax.swing.JTextField jTextField12;
		private javax.swing.JTextField jTextField13;
		private javax.swing.JTextField jTextField14;
		private javax.swing.JTextField jTextField15;
		private javax.swing.JTextField jTextField16;
		private javax.swing.JTextField jTextField17;
		private javax.swing.JTextField jTextField18;
		private javax.swing.JTextField jTextField19;
		private javax.swing.JTextField jTextField2;
		private javax.swing.JTextField jTextField20;
		private javax.swing.JTextField jTextField21;
		private javax.swing.JTextField jTextField22;
		private javax.swing.JTextField jTextField23;
		private javax.swing.JTextField jTextField24;
		private javax.swing.JTextField jTextField25;
		private javax.swing.JTextField jTextField26;
		private javax.swing.JTextField jTextField27;
		private javax.swing.JTextField jTextField28;
		private javax.swing.JTextField jTextField29;
		private javax.swing.JTextField jTextField3;
		private javax.swing.JTextField jTextField30;
		private javax.swing.JTextField jTextField31;
		private javax.swing.JTextField jTextField32;
		private javax.swing.JTextField jTextField33;
		private javax.swing.JTextField jTextField34;
		private javax.swing.JTextField jTextField35;
		private javax.swing.JTextField jTextField36;
		private javax.swing.JTextField jTextField37;
		private javax.swing.JTextField jTextField38;
		private javax.swing.JTextField jTextField39;
		private javax.swing.JTextField jTextField4;
		private javax.swing.JTextField jTextField5;
		private javax.swing.JTextField jTextField6;
		private javax.swing.JTextField jTextField7;
		private javax.swing.JTextField jTextField8;
		private javax.swing.JTextField jTextField9;
		private javax.swing.JCheckBox pc;
		private javax.swing.JLabel priceCheckWarn;
		private javax.swing.JButton start;
		private javax.swing.JCheckBox xp;

		// End of variables declaration
		public Config(final avianProHidendra a) {
			this.a = a;
			initComponents();
			setResizable(false);
			setVisible(true);
		}

		public boolean canContinue() {
			return cont;
		}

		private void Donate(final ActionEvent evt) {
			a.openPayPalDonation();
		}

		private String getBoltState() {
			switch (boltSlider.getValue()) {
			case 0:
				return "Make room for bolts; this will drop/bury a bone or eat any food to make room.";
			case 1:
				return "Make room; but do not eat sharks to do so.";
			case 2:
				return "Don't make room; only pick up bolts when there is room in the inventory.";
			default:
				return "Unknown state.";
			}
		}

		private String getPriceCheckState() {
			if (pc.isSelected()) {
				return "WARNING: Make sure the Interface Closer anti-random is turned OFF before using Price Checker.";
			} else {
				return "";
			}
		}

		// <editor-fold defaultstate="collapsed" desc="Generated Code">
		private void initComponents() {

			jLabel1 = new javax.swing.JLabel();
			jLabel2 = new javax.swing.JLabel();
			jTabbedPane1 = new javax.swing.JTabbedPane();
			jPanel1 = new javax.swing.JPanel();
			jLabel3 = new javax.swing.JLabel();
			av69 = new javax.swing.JCheckBox();
			av71 = new javax.swing.JCheckBox();
			av73 = new javax.swing.JCheckBox();
			av79 = new javax.swing.JCheckBox();
			av84 = new javax.swing.JCheckBox();
			av92 = new javax.swing.JCheckBox();
			av94 = new javax.swing.JCheckBox();
			av97 = new javax.swing.JCheckBox();
			av137 = new javax.swing.JCheckBox();
			av148 = new javax.swing.JCheckBox();
			jLabel4 = new javax.swing.JLabel();
			jTextField1 = new javax.swing.JTextField();
			jLabel5 = new javax.swing.JLabel();
			jTextField2 = new javax.swing.JTextField();
			jLabel6 = new javax.swing.JLabel();
			jLabel7 = new javax.swing.JLabel();
			jTextField3 = new javax.swing.JTextField();
			jLabel8 = new javax.swing.JLabel();
			jLabel9 = new javax.swing.JLabel();
			jTextField4 = new javax.swing.JTextField();
			jLabel10 = new javax.swing.JLabel();
			jLabel11 = new javax.swing.JLabel();
			jCheckBox1 = new javax.swing.JCheckBox();
			jLabel12 = new javax.swing.JLabel();
			jCheckBox2 = new javax.swing.JCheckBox();
			jLabel13 = new javax.swing.JLabel();
			jLabel14 = new javax.swing.JLabel();
			jCheckBox3 = new javax.swing.JCheckBox();
			jCheckBox4 = new javax.swing.JCheckBox();
			jLabel62 = new javax.swing.JLabel();
			jTextField39 = new javax.swing.JTextField();
			jLabel63 = new javax.swing.JLabel();
			jPanel2 = new javax.swing.JPanel();
			jCheckBox5 = new javax.swing.JCheckBox();
			jCheckBox6 = new javax.swing.JCheckBox();
			jCheckBox7 = new javax.swing.JCheckBox();
			jCheckBox8 = new javax.swing.JCheckBox();
			jCheckBox9 = new javax.swing.JCheckBox();
			jCheckBox10 = new javax.swing.JCheckBox();
			jCheckBox11 = new javax.swing.JCheckBox();
			jCheckBox12 = new javax.swing.JCheckBox();
			jCheckBox14 = new javax.swing.JCheckBox();
			jPanel3 = new javax.swing.JPanel();
			boltSlider = new javax.swing.JSlider();
			jLabel16 = new javax.swing.JLabel();
			jPanel4 = new javax.swing.JPanel();
			jLabel17 = new javax.swing.JLabel();
			jCheckBox13 = new javax.swing.JCheckBox();
			jLabel18 = new javax.swing.JLabel();
			jTextField5 = new javax.swing.JTextField();
			jLabel19 = new javax.swing.JLabel();
			jTextField6 = new javax.swing.JTextField();
			jLabel20 = new javax.swing.JLabel();
			jTextField7 = new javax.swing.JTextField();
			jLabel21 = new javax.swing.JLabel();
			jLabel22 = new javax.swing.JLabel();
			jPanel5 = new javax.swing.JPanel();
			jLabel36 = new javax.swing.JLabel();
			jLabel38 = new javax.swing.JLabel();
			jTextField16 = new javax.swing.JTextField();
			jLabel39 = new javax.swing.JLabel();
			jLabel40 = new javax.swing.JLabel();
			jLabel41 = new javax.swing.JLabel();
			jTextField19 = new javax.swing.JTextField();
			jLabel42 = new javax.swing.JLabel();
			jTextField20 = new javax.swing.JTextField();
			jLabel43 = new javax.swing.JLabel();
			jTextField21 = new javax.swing.JTextField();
			jLabel44 = new javax.swing.JLabel();
			jTextField22 = new javax.swing.JTextField();
			jLabel45 = new javax.swing.JLabel();
			jTextField23 = new javax.swing.JTextField();
			jLabel46 = new javax.swing.JLabel();
			jTextField24 = new javax.swing.JTextField();
			jLabel47 = new javax.swing.JLabel();
			jTextField25 = new javax.swing.JTextField();
			jLabel48 = new javax.swing.JLabel();
			jTextField26 = new javax.swing.JTextField();
			jLabel49 = new javax.swing.JLabel();
			jTextField27 = new javax.swing.JTextField();
			jLabel50 = new javax.swing.JLabel();
			jTextField28 = new javax.swing.JTextField();
			jLabel51 = new javax.swing.JLabel();
			jTextField29 = new javax.swing.JTextField();
			jLabel52 = new javax.swing.JLabel();
			jTextField30 = new javax.swing.JTextField();
			jLabel53 = new javax.swing.JLabel();
			jTextField31 = new javax.swing.JTextField();
			jLabel54 = new javax.swing.JLabel();
			jTextField32 = new javax.swing.JTextField();
			jLabel55 = new javax.swing.JLabel();
			jTextField33 = new javax.swing.JTextField();
			jLabel56 = new javax.swing.JLabel();
			jTextField34 = new javax.swing.JTextField();
			jLabel57 = new javax.swing.JLabel();
			jTextField35 = new javax.swing.JTextField();
			jTextField17 = new javax.swing.JTextField();
			jTextField18 = new javax.swing.JTextField();
			jLabel58 = new javax.swing.JLabel();
			jTextField36 = new javax.swing.JTextField();
			jPanel6 = new javax.swing.JPanel();
			pc = new javax.swing.JCheckBox();
			jTextField8 = new javax.swing.JTextField();
			jLabel23 = new javax.swing.JLabel();
			jTextField9 = new javax.swing.JTextField();
			jLabel24 = new javax.swing.JLabel();
			jTextField10 = new javax.swing.JTextField();
			jLabel25 = new javax.swing.JLabel();
			jLabel26 = new javax.swing.JLabel();
			xp = new javax.swing.JCheckBox();
			jLabel27 = new javax.swing.JLabel();
			jTextField11 = new javax.swing.JTextField();
			jTextField12 = new javax.swing.JTextField();
			jLabel28 = new javax.swing.JLabel();
			jLabel29 = new javax.swing.JLabel();
			jLabel30 = new javax.swing.JLabel();
			jTextField13 = new javax.swing.JTextField();
			jLabel31 = new javax.swing.JLabel();
			jCheckBox16 = new javax.swing.JCheckBox();
			jLabel32 = new javax.swing.JLabel();
			jTextField14 = new javax.swing.JTextField();
			jLabel33 = new javax.swing.JLabel();
			jLabel34 = new javax.swing.JLabel();
			jTextField15 = new javax.swing.JTextField();
			jLabel35 = new javax.swing.JLabel();
			jCheckBox17 = new javax.swing.JCheckBox();
			priceCheckWarn = new javax.swing.JLabel();
			jLabel37 = new javax.swing.JLabel();
			jPanel8 = new javax.swing.JPanel();
			jLabel59 = new javax.swing.JLabel();
			jTextField37 = new javax.swing.JTextField();
			jLabel60 = new javax.swing.JLabel();
			jTextField38 = new javax.swing.JTextField();
			jLabel61 = new javax.swing.JLabel();
			jScrollPane2 = new javax.swing.JScrollPane();
			jTextArea2 = new javax.swing.JTextArea();
			jPanel9 = new javax.swing.JPanel();
			jScrollPane3 = new javax.swing.JScrollPane();
			jTextArea3 = new javax.swing.JTextArea();
			jPanel7 = new javax.swing.JPanel();
			jScrollPane1 = new javax.swing.JScrollPane();
			jTextArea1 = new javax.swing.JTextArea();
			jLabel15 = new javax.swing.JLabel();
			start = new javax.swing.JButton();
			jButton2 = new javax.swing.JButton();

			setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
			setTitle("avianPro v" + a.getVersion() + " Configuration");
			setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
			setResizable(false);

			jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 24));
			jLabel1.setForeground(new java.awt.Color(255, 0, 0));
			jLabel1.setText("Author: Hidendra;  avianPro v" + a.getVersion());

			jLabel2.setFont(new java.awt.Font("DejaVu Sans", 0, 24));
			jLabel2.setText("Configuration");

			jTabbedPane1.setBorder(javax.swing.BorderFactory.createEmptyBorder(
					10, 10, 10, 10));
			jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.LEFT);

			jLabel3.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel3.setText("Aviansies to Attack:");

			av69.setSelected(a.getConfig("69").equals("true") ? true : false);
			av69.setText("69");

			av71.setSelected(a.getConfig("71").equals("true") ? true : false);
			av71.setText("71");

			av73.setSelected(a.getConfig("73").equals("true") ? true : false);
			av73.setText("73");

			av79.setSelected(a.getConfig("79").equals("true") ? true : false);
			av79.setText("79");

			av84.setSelected(a.getConfig("84").equals("true") ? true : false);
			av84.setText("84");

			av92.setSelected(a.getConfig("92").equals("true") ? true : false);
			av92.setText("92");

			av94.setSelected(a.getConfig("94").equals("true") ? true : false);
			av94.setText("94");

			av97.setSelected(a.getConfig("97").equals("true") ? true : false);
			av97.setText("97");

			av137.setSelected(a.getConfig("137").equals("true") ? true : false);
			av137.setText("137");

			av148.setSelected(a.getConfig("148").equals("true") ? true : false);
			av148.setText("148");
			av148.setActionCommand("av148");

			jLabel4.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel4.setText("Eat Ranges:");

			jTextField1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField1.setText(a.getConfig("eatr1"));

			jLabel5.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel5.setText("-");

			jTextField2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField2.setText(a.getConfig("eatr2"));

			jLabel6.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel6.setText("HP");

			jLabel7.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel7.setText("Emergency Teleport:");

			jTextField3.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField3.setText(a.getConfig("teleat"));

			jLabel8
					.setText("HP.  Script will teleport no matter what when this HP is reached.");

			jLabel9.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel9.setText("Use BTP at:");

			jTextField4.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField4.setText(a.getConfig("btp"));

			jLabel10.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel10.setText("Bones");

			jLabel11.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel11.setText("Alch RuneDaggers/Limbs");

			jCheckBox1.setSelected(a.getConfig("alch").equals("true") ? true
					: false);
			jCheckBox1.setText("Includes picking up.");

			jLabel12.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel12.setText("Bury Bones to make room:");

			jCheckBox2.setSelected(a.getConfig("bury").equals("true") ? true
					: false);

			jLabel13.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel13.setText("Use Potions:");

			jLabel14.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel14.setText("Activate Paint:");

			jCheckBox3.setSelected(a.getConfig("potions").equals("true") ? true
					: false);
			jCheckBox3
					.setText("Potions only includes use of Ranged and [Super/Regular] Defence potions");

			jCheckBox4.setSelected(a.getConfig("paint").equals("true") ? true
					: false);
			jCheckBox4
					.setText("This also disables every Anti-ban enabled if Paint is disabled. You are warned.");

			jLabel62
					.setText("HP. Script will eat / use btp (if no food) no matter what at this hp level.");

			jTextField39.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField39.setText(a.getConfig("emereat"));

			jLabel63.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel63.setText("Emergency eat:");

			final javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
					jPanel1);
			jPanel1.setLayout(jPanel1Layout);
			jPanel1Layout
					.setHorizontalGroup(jPanel1Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel1Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel4)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jTextField1,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					48,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addGap(
																					1,
																					1,
																					1)
																			.addComponent(
																					jLabel5)
																			.addGap(
																					5,
																					5,
																					5)
																			.addComponent(
																					jTextField2,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					50,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addGap(
																					2,
																					2,
																					2)
																			.addComponent(
																					jLabel6))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel3)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av69)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av71)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av73)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av79)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av84)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av92)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av94)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av97)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av137)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					av148))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel63)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jTextField39,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					55,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jLabel62))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel7)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jTextField3,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					55,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jLabel8))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel9)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jTextField4,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					38,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jLabel10))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel11)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jCheckBox1))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel12)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jCheckBox2))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel13)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jCheckBox3))
															.addGroup(
																	jPanel1Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel14)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jCheckBox4)))
											.addContainerGap(155,
													Short.MAX_VALUE)));
			jPanel1Layout
					.setVerticalGroup(jPanel1Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel1Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel3)
															.addComponent(av69)
															.addComponent(av71)
															.addComponent(av73)
															.addComponent(av79)
															.addComponent(av84)
															.addComponent(av92)
															.addComponent(av94)
															.addComponent(av97)
															.addComponent(av137)
															.addComponent(av148))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel4)
															.addComponent(
																	jTextField1,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel5)
															.addComponent(
																	jTextField2,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel6))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel63)
															.addComponent(
																	jTextField39,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel62))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel7)
															.addComponent(
																	jTextField3,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel8))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel9)
															.addComponent(
																	jTextField4,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel10))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel11)
															.addComponent(
																	jCheckBox1))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel12)
															.addComponent(
																	jCheckBox2))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel13)
															.addComponent(
																	jCheckBox3))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel1Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel14)
															.addComponent(
																	jCheckBox4))
											.addContainerGap(149,
													Short.MAX_VALUE)));

			av148.getAccessibleContext().setAccessibleName("av148");

			jTabbedPane1.addTab("Main", jPanel1);

			jCheckBox5.setSelected(a.getConfig("bolts").equals("true") ? true
					: false);
			jCheckBox5.setText("Bolts");

			jCheckBox6.setSelected(a.getConfig("clue").equals("true") ? true
					: false);
			jCheckBox6.setText("Clue scrolls");

			jCheckBox7
					.setSelected(a.getConfig("swordfish").equals("true") ? true
							: false);
			jCheckBox7.setText("Swordfishes");

			jCheckBox8.setSelected(a.getConfig("bloods").equals("true") ? true
					: false);
			jCheckBox8.setText("Blood runes");

			jCheckBox9.setSelected(a.getConfig("waters").equals("true") ? true
					: false);
			jCheckBox9.setText("Water runes");

			jCheckBox10.setSelected(a.getConfig("airs").equals("true") ? true
					: false);
			jCheckBox10.setText("Air runes");

			jCheckBox11.setSelected(a.getConfig("laws").equals("true") ? true
					: false);
			jCheckBox11.setText("Law runes");

			jCheckBox12
					.setSelected(a.getConfig("ranarrs").equals("true") ? true
							: false);
			jCheckBox12
					.setText("Ranarrs  -- ONLY recommended if you are using Prayer.");

			jCheckBox14.setSelected(a.getConfig("chaos").equals("true") ? true
					: false);
			jCheckBox14.setText("Chaos runes");

			final javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(
					jPanel2);
			jPanel2.setLayout(jPanel2Layout);
			jPanel2Layout
					.setHorizontalGroup(jPanel2Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel2Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel2Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addComponent(
																	jCheckBox5)
															.addComponent(
																	jCheckBox6)
															.addComponent(
																	jCheckBox7)
															.addComponent(
																	jCheckBox8)
															.addComponent(
																	jCheckBox9)
															.addComponent(
																	jCheckBox10)
															.addComponent(
																	jCheckBox11)
															.addComponent(
																	jCheckBox14)
															.addComponent(
																	jCheckBox12))
											.addContainerGap(450,
													Short.MAX_VALUE)));
			jPanel2Layout
					.setVerticalGroup(jPanel2Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel2Layout
											.createSequentialGroup()
											.addContainerGap()
											.addComponent(jCheckBox5)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox6)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox7)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox8)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox9)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox10)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox11)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox14)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(jCheckBox12)
											.addContainerGap(269,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Pickup", jPanel2);

			boltSlider.setMajorTickSpacing(1);
			boltSlider.setMaximum(2);
			boltSlider.setPaintLabels(true);
			boltSlider.setPaintTicks(true);
			boltSlider.setSnapToTicks(true);
			boltSlider.setValue(Integer.parseInt(a.getConfig("boltpri")));
			boltSlider
					.addChangeListener(new javax.swing.event.ChangeListener() {
						public void stateChanged(
								final javax.swing.event.ChangeEvent evt) {
							updateState(evt);
						}
					});

			jLabel16.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
			jLabel16.setText("State: " + getBoltState());

			final javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(
					jPanel3);
			jPanel3.setLayout(jPanel3Layout);
			jPanel3Layout
					.setHorizontalGroup(jPanel3Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel3Layout
											.createSequentialGroup()
											.addGroup(
													jPanel3Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel3Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					jLabel16,
																					javax.swing.GroupLayout.DEFAULT_SIZE,
																					815,
																					Short.MAX_VALUE))
															.addGroup(
																	jPanel3Layout
																			.createSequentialGroup()
																			.addGap(
																					272,
																					272,
																					272)
																			.addComponent(
																					boltSlider,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					284,
																					javax.swing.GroupLayout.PREFERRED_SIZE)))
											.addContainerGap()));
			jPanel3Layout
					.setVerticalGroup(jPanel3Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel3Layout
											.createSequentialGroup()
											.addGap(18, 18, 18)
											.addComponent(
													boltSlider,
													javax.swing.GroupLayout.PREFERRED_SIZE,
													79,
													javax.swing.GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
											.addComponent(jLabel16)
											.addContainerGap(396,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Priority", jPanel3);

			jLabel17.setFont(new java.awt.Font("DejaVu Sans", 0, 24));
			jLabel17.setText("Activate Prayer:");

			jCheckBox13.setSelected(a.getConfig("prayer").equals("true") ? true
					: false);
			jCheckBox13.setText("This includes drinking Prayer Potions");

			jLabel18.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel18.setText("Prayer drink ranges:");

			jTextField5.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField5.setText(a.getConfig("prayr1"));

			jLabel19.setText("-");

			jTextField6.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField6.setText(a.getConfig("prayr2"));

			jLabel20.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel20.setText("Emergency Prayer Drink:");

			jTextField7.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField7.setText(a.getConfig("prayat"));

			jLabel21
					.setText("Prayer.  Script will drink a dose of a Prayer Potion no matter what at this prayer.");

			jLabel22.setText("Prayer");

			final javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(
					jPanel4);
			jPanel4.setLayout(jPanel4Layout);
			jPanel4Layout
					.setHorizontalGroup(jPanel4Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel4Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel4Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel4Layout
																			.createSequentialGroup()
																			.addGroup(
																					jPanel4Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING)
																							.addComponent(
																									jLabel18)
																							.addComponent(
																									jLabel17))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel4Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING)
																							.addComponent(
																									jCheckBox13)
																							.addGroup(
																									jPanel4Layout
																											.createSequentialGroup()
																											.addComponent(
																													jTextField5,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													39,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													2,
																													2,
																													2)
																											.addComponent(
																													jLabel19)
																											.addGap(
																													5,
																													5,
																													5)
																											.addComponent(
																													jTextField6,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													47,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jLabel22))))
															.addGroup(
																	jPanel4Layout
																			.createSequentialGroup()
																			.addComponent(
																					jLabel20)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jTextField7,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					49,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jLabel21)))
											.addContainerGap(23,
													Short.MAX_VALUE)));
			jPanel4Layout
					.setVerticalGroup(jPanel4Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel4Layout
											.createSequentialGroup()
											.addGroup(
													jPanel4Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel4Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					jLabel17)
																			.addGap(
																					45,
																					45,
																					45)
																			.addGroup(
																					jPanel4Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel18)
																							.addComponent(
																									jTextField5,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)
																							.addComponent(
																									jLabel19)
																							.addComponent(
																									jTextField6,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)
																							.addComponent(
																									jLabel22)))
															.addGroup(
																	jPanel4Layout
																			.createSequentialGroup()
																			.addGap(
																					24,
																					24,
																					24)
																			.addComponent(
																					jCheckBox13)))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel4Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel20)
															.addComponent(
																	jTextField7,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel21))
											.addContainerGap(369,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Prayer", jPanel4);

			jLabel36.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel36.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
			jLabel36
					.setText("These variables are NOT to be foolishly modified.");
			jLabel36.setToolTipText("");

			jLabel38.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel38.setText("CameraInt1");

			jTextField16.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField16.setText(a.getSetting("CameraInt1"));

			jLabel39.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel39.setText("EnableRunInt1");

			jLabel40.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel40.setText("DrinkInt1");

			jLabel41.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel41.setText("DropsInt2");

			jTextField19.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField19.setText(a.getSetting("DropsInt2"));

			jLabel42.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel42.setText("DropsInt1");

			jTextField20.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField20.setText(a.getSetting("DropsInt1"));

			jLabel43.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel43.setText("AttackInt1");

			jTextField21.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField21.setText(a.getSetting("AttackInt1"));

			jLabel44.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel44.setText("TeleportInt1");

			jTextField22.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField22.setText(a.getSetting("Kree'ArraInt1"));

			jLabel45.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel45.setText("SpiritualInt1");

			jTextField23.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField23.setText(a.getSetting("SpiritualInt1"));

			jLabel46.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel46.setText("CheckExpInt1");

			jTextField24.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField24.setText(a.getSetting("CheckExpWaitInt1"));

			jLabel47.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel47.setText("FoodInt2");

			jTextField25.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField25.setText(a.getSetting("FoodInt2"));

			jLabel48.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel48.setText("FoodInt1");

			jTextField26.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField26.setText(a.getSetting("FoodInt1"));

			jLabel49.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel49.setText("FoodInt3");

			jTextField27.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField27.setText(a.getSetting("FoodInt3"));

			jLabel50.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel50.setText("BoneInt1");

			jTextField28.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField28.setText(a.getSetting("BoneInt1"));

			jLabel51.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel51.setText("BoneInt2");

			jTextField29.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField29.setText(a.getSetting("BoneInt2"));

			jLabel52.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel52.setText("PrayerInt2");

			jTextField30.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField30.setText(a.getSetting("PrayerInt2"));

			jLabel53.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel53.setText("PrayerInt1");

			jTextField31.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField31.setText(a.getSetting("PrayerInt1"));

			jLabel54.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel54.setText("PrayerInt3");

			jTextField32.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField32.setText(a.getSetting("PrayerInt3"));

			jLabel55.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel55.setText("PotionsInt2");

			jTextField33.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField33.setText(a.getSetting("PotionsInt2"));

			jLabel56.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel56.setText("PotionsInt1");

			jTextField34.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField34.setText(a.getSetting("PotionsInt1"));

			jLabel57.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel57.setText("AvianHandleInt1");

			jTextField35.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField35.setText(a.getSetting("AvianHandleWaitInt1"));

			jTextField17.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField17.setText(a.getSetting("EnableRunInt1"));

			jTextField18.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField18.setText(a.getSetting("DrinkInt1"));

			jLabel58.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel58.setText("DropJunkInt1");

			jTextField36.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField36.setText(a.getSetting("DropJunkInt1"));

			final javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(
					jPanel5);
			jPanel5.setLayout(jPanel5Layout);
			jPanel5Layout
					.setHorizontalGroup(jPanel5Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel5Layout
											.createSequentialGroup()
											.addGroup(
													jPanel5Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel5Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					jLabel36,
																					javax.swing.GroupLayout.DEFAULT_SIZE,
																					815,
																					Short.MAX_VALUE))
															.addGroup(
																	jPanel5Layout
																			.createSequentialGroup()
																			.addGap(
																					30,
																					30,
																					30)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.TRAILING)
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel41)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField19,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel42)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField20,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel43)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField21,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel44)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField22,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel45)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField23,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel46)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField24,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel47)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField25,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel48)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField26,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel49)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField27,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel50)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField28,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel51)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField29,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addGroup(
																													jPanel5Layout
																															.createParallelGroup(
																																	javax.swing.GroupLayout.Alignment.TRAILING)
																															.addComponent(
																																	jLabel39)
																															.addComponent(
																																	jLabel38)
																															.addComponent(
																																	jLabel40))
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addGroup(
																													jPanel5Layout
																															.createParallelGroup(
																																	javax.swing.GroupLayout.Alignment.LEADING,
																																	false)
																															.addGroup(
																																	javax.swing.GroupLayout.Alignment.TRAILING,
																																	jPanel5Layout
																																			.createSequentialGroup()
																																			.addComponent(
																																					jTextField18,
																																					0,
																																					0,
																																					Short.MAX_VALUE)
																																			.addPreferredGap(
																																					javax.swing.LayoutStyle.ComponentPlacement.RELATED))
																															.addGroup(
																																	javax.swing.GroupLayout.Alignment.TRAILING,
																																	jPanel5Layout
																																			.createSequentialGroup()
																																			.addComponent(
																																					jTextField17,
																																					0,
																																					0,
																																					Short.MAX_VALUE)
																																			.addPreferredGap(
																																					javax.swing.LayoutStyle.ComponentPlacement.RELATED))
																															.addComponent(
																																	jTextField16,
																																	javax.swing.GroupLayout.Alignment.TRAILING,
																																	javax.swing.GroupLayout.DEFAULT_SIZE,
																																	75,
																																	Short.MAX_VALUE))))
																			.addGap(
																					82,
																					82,
																					82)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.TRAILING)
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel52)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField30,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel53)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField31,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel54)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField32,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel55)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField33,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel56)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField34,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE))
																							.addGroup(
																									jPanel5Layout
																											.createSequentialGroup()
																											.addGroup(
																													jPanel5Layout
																															.createParallelGroup(
																																	javax.swing.GroupLayout.Alignment.TRAILING)
																															.addComponent(
																																	jLabel58)
																															.addComponent(
																																	jLabel57))
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addGroup(
																													jPanel5Layout
																															.createParallelGroup(
																																	javax.swing.GroupLayout.Alignment.LEADING,
																																	false)
																															.addComponent(
																																	jTextField36,
																																	0,
																																	0,
																																	Short.MAX_VALUE)
																															.addComponent(
																																	jTextField35,
																																	javax.swing.GroupLayout.DEFAULT_SIZE,
																																	75,
																																	Short.MAX_VALUE))))))
											.addContainerGap()));
			jPanel5Layout
					.setVerticalGroup(jPanel5Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel5Layout
											.createSequentialGroup()
											.addContainerGap()
											.addComponent(jLabel36)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addGroup(
													jPanel5Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel5Layout
																			.createSequentialGroup()
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel38)
																							.addComponent(
																									jTextField16,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.TRAILING)
																							.addComponent(
																									jTextField17,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)
																							.addComponent(
																									jLabel39))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jTextField18,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)
																							.addComponent(
																									jLabel40))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel42)
																							.addComponent(
																									jTextField20,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel41)
																							.addComponent(
																									jTextField19,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel43)
																							.addComponent(
																									jTextField21,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel45)
																							.addComponent(
																									jTextField23,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel44)
																							.addComponent(
																									jTextField22,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel46)
																							.addComponent(
																									jTextField24,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel48)
																							.addComponent(
																									jTextField26,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel47)
																							.addComponent(
																									jTextField25,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel49)
																							.addComponent(
																									jTextField27,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel50)
																							.addComponent(
																									jTextField28,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel51)
																							.addComponent(
																									jTextField29,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)))
															.addGroup(
																	jPanel5Layout
																			.createSequentialGroup()
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel53)
																							.addComponent(
																									jTextField31,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel52)
																							.addComponent(
																									jTextField30,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel54)
																							.addComponent(
																									jTextField32,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel56)
																							.addComponent(
																									jTextField34,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel55)
																							.addComponent(
																									jTextField33,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.BASELINE)
																							.addComponent(
																									jLabel57)
																							.addComponent(
																									jTextField35,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel5Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.TRAILING)
																							.addComponent(
																									jTextField36,
																									javax.swing.GroupLayout.PREFERRED_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.PREFERRED_SIZE)
																							.addComponent(
																									jLabel58))))
											.addContainerGap(31,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Customize", jPanel5);

			pc.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			pc.setText("Price-check between:");
			pc.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(final java.awt.event.ActionEvent evt) {
					updatePriceCheck(evt);
				}
			});

			jTextField8.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField8.setText(a.getConfig("pc1"));

			jLabel23.setText("-");

			jTextField9.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField9.setText(a.getConfig("pc2"));

			jLabel24.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel24.setText("Wait");

			jTextField10.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField10.setText(a.getConfig("pcwait"));

			jLabel25.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel25.setText("seconds");

			jLabel26.setText("before closing the Price Checker interface.");

			xp.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			xp.setText("Check range xp between:");

			jLabel27.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel27.setText("minutes");

			jTextField11.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField11.setText(a.getConfig("xp1"));

			jTextField12.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField12.setText(a.getConfig("pc2"));

			jLabel28.setText("-");

			jLabel29.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel29.setText("minutes");

			jLabel30.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel30.setText("GP Goal:");

			jTextField13.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField13.setText(a.getConfig("gpgoal"));

			jLabel31.setFont(new java.awt.Font("DejaVu Sans", 1, 14));
			jLabel31.setText("Logout after goal:");

			jCheckBox16
					.setSelected(a.getConfig("logoutgoal").equals("true") ? true
							: false);

			jLabel32.setFont(new java.awt.Font("DejaVu Sans", 0, 18));
			jLabel32.setText("Run for:");

			jTextField14.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField14.setText(a.getConfig("runhours"));

			jLabel33.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel33.setText("hours");

			jLabel34.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel34.setText("minutes");

			jTextField15.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField15.setText(a.getConfig("runminutes"));

			jLabel35.setFont(new java.awt.Font("DejaVu Sans", 1, 14));
			jLabel35.setText("Enabled:");

			jCheckBox17
					.setSelected(a.getConfig("runenabled").equals("true") ? true
							: false);

			priceCheckWarn.setFont(new java.awt.Font("DejaVu Sans", 1, 14));
			priceCheckWarn.setForeground(new java.awt.Color(255, 0, 0));
			priceCheckWarn.setText(" ");

			jLabel37.setFont(new java.awt.Font("DejaVu Sans", 0, 14));
			jLabel37.setText("k");

			final javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(
					jPanel6);
			jPanel6.setLayout(jPanel6Layout);
			jPanel6Layout
					.setHorizontalGroup(jPanel6Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel6Layout
											.createSequentialGroup()
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel6Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addGroup(
																					jPanel6Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING)
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addGap(
																													12,
																													12,
																													12)
																											.addComponent(
																													jLabel24)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField10,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													32,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jLabel25)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jLabel26))
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addComponent(
																													pc)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField8,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													57,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													3,
																													3,
																													3)
																											.addComponent(
																													jLabel23)
																											.addGap(
																													2,
																													2,
																													2)
																											.addComponent(
																													jTextField9,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													54,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jLabel27))
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addComponent(
																													xp)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField11,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													49,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													3,
																													3,
																													3)
																											.addComponent(
																													jLabel28)
																											.addGap(
																													2,
																													2,
																													2)
																											.addComponent(
																													jTextField12,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													54,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jLabel29))))
															.addGroup(
																	jPanel6Layout
																			.createSequentialGroup()
																			.addGap(
																					34,
																					34,
																					34)
																			.addGroup(
																					jPanel6Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING)
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel30)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField13,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													75,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													2,
																													2,
																													2)
																											.addComponent(
																													jLabel37))
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addGap(
																													12,
																													12,
																													12)
																											.addComponent(
																													jLabel31)
																											.addGap(
																													12,
																													12,
																													12)
																											.addComponent(
																													jCheckBox16))
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addComponent(
																													jLabel32)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField14,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													59,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													1,
																													1,
																													1)
																											.addComponent(
																													jLabel33)
																											.addPreferredGap(
																													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																											.addComponent(
																													jTextField15,
																													javax.swing.GroupLayout.PREFERRED_SIZE,
																													55,
																													javax.swing.GroupLayout.PREFERRED_SIZE)
																											.addGap(
																													3,
																													3,
																													3)
																											.addComponent(
																													jLabel34))
																							.addGroup(
																									jPanel6Layout
																											.createSequentialGroup()
																											.addGap(
																													12,
																													12,
																													12)
																											.addComponent(
																													jLabel35)
																											.addGap(
																													12,
																													12,
																													12)
																											.addComponent(
																													jCheckBox17))))
															.addGroup(
																	jPanel6Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					priceCheckWarn)))
											.addContainerGap(383,
													Short.MAX_VALUE)));
			jPanel6Layout
					.setVerticalGroup(jPanel6Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel6Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(pc)
															.addComponent(
																	jTextField8,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jTextField9,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel23)
															.addComponent(
																	jLabel27))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel24)
															.addComponent(
																	jTextField10,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel25)
															.addComponent(
																	jLabel26))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(xp)
															.addComponent(
																	jTextField11,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jTextField12,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel28)
															.addComponent(
																	jLabel29))
											.addGap(30, 30, 30)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel30)
															.addComponent(
																	jTextField13,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel37))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel31)
															.addComponent(
																	jCheckBox16))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel32)
															.addComponent(
																	jTextField14,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel33)
															.addComponent(
																	jTextField15,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE)
															.addComponent(
																	jLabel34))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addGroup(
													jPanel6Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel35)
															.addComponent(
																	jCheckBox17))
											.addGap(92, 92, 92).addComponent(
													priceCheckWarn)
											.addContainerGap(147,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Anti-ban", jPanel6);

			jLabel59.setFont(new java.awt.Font("DejaVu Sans", 0, 15));
			jLabel59.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel59.setText("RSBot avianPro Thread:");

			jTextField37.setEditable(false);
			jTextField37.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
			jTextField37.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField37
					.setText("http://www.rsbot.org/vb/showthread.php?t=27580");

			jLabel60.setFont(new java.awt.Font("DejaVu Sans", 0, 15));
			jLabel60.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel60.setText("Outdated? Current version:");

			jTextField38.setEditable(false);
			jTextField38.setFont(new java.awt.Font("DejaVu Sans", 1, 13));
			jTextField38.setHorizontalAlignment(javax.swing.JTextField.CENTER);
			jTextField38
					.setText("http://www.rs2reborn.net/avianProHidendra.java");

			jLabel61.setFont(new java.awt.Font("DejaVu Sans", 0, 15));
			jLabel61.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
			jLabel61.setText("Contact Hidendra directly:");

			jTextArea2.setColumns(20);
			jTextArea2.setEditable(false);
			jTextArea2.setFont(new java.awt.Font("DejaVu Sans", 1, 13)); // NOI18N
			jTextArea2.setRows(5);
			jTextArea2
					.setText("  MSN: hid.en.dra@hotmail.com\n  Skype: Hidendra_\n\n  I can not guarantee I can or will help if you contact me directly. \n  If I tell you I am busy and to please leave me alone and post, please do so.\n  I do my best to help everyone via the forums, so maybe post there first.");
			jScrollPane2.setViewportView(jTextArea2);

			final javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(
					jPanel8);
			jPanel8.setLayout(jPanel8Layout);
			jPanel8Layout
					.setHorizontalGroup(jPanel8Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel8Layout
											.createSequentialGroup()
											.addGroup(
													jPanel8Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel8Layout
																			.createSequentialGroup()
																			.addGap(
																					22,
																					22,
																					22)
																			.addComponent(
																					jLabel61)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jScrollPane2,
																					javax.swing.GroupLayout.DEFAULT_SIZE,
																					604,
																					Short.MAX_VALUE))
															.addGroup(
																	jPanel8Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addGroup(
																					jPanel8Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING,
																									false)
																							.addComponent(
																									jLabel59,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									Short.MAX_VALUE)
																							.addComponent(
																									jLabel60))
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addGroup(
																					jPanel8Layout
																							.createParallelGroup(
																									javax.swing.GroupLayout.Alignment.LEADING)
																							.addComponent(
																									jTextField37,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									604,
																									Short.MAX_VALUE)
																							.addComponent(
																									jTextField38,
																									javax.swing.GroupLayout.DEFAULT_SIZE,
																									604,
																									Short.MAX_VALUE))))
											.addContainerGap()));
			jPanel8Layout
					.setVerticalGroup(jPanel8Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel8Layout
											.createSequentialGroup()
											.addGroup(
													jPanel8Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	jPanel8Layout
																			.createSequentialGroup()
																			.addGap(
																					28,
																					28,
																					28)
																			.addComponent(
																					jLabel61))
															.addGroup(
																	jPanel8Layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					jScrollPane2,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					107,
																					javax.swing.GroupLayout.PREFERRED_SIZE)))
											.addGap(18, 18, 18)
											.addGroup(
													jPanel8Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel59)
															.addComponent(
																	jTextField37,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
											.addGroup(
													jPanel8Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.BASELINE)
															.addComponent(
																	jLabel60)
															.addComponent(
																	jTextField38,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE))
											.addContainerGap(324,
													Short.MAX_VALUE)));

			jTabbedPane1.addTab("Support", jPanel8);

			jTextArea3.setColumns(20);
			jTextArea3.setEditable(false);
			jTextArea3.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N
			jTextArea3.setRows(5);
			jTextArea3.setText(a.getFAQ());
			jScrollPane3.setViewportView(jTextArea3);

			final javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(
					jPanel9);
			jPanel9.setLayout(jPanel9Layout);
			jPanel9Layout.setHorizontalGroup(jPanel9Layout.createParallelGroup(
					javax.swing.GroupLayout.Alignment.LEADING).addGroup(
					jPanel9Layout.createSequentialGroup().addContainerGap()
							.addComponent(jScrollPane3,
									javax.swing.GroupLayout.DEFAULT_SIZE, 815,
									Short.MAX_VALUE).addContainerGap()));
			jPanel9Layout.setVerticalGroup(jPanel9Layout.createParallelGroup(
					javax.swing.GroupLayout.Alignment.LEADING).addGroup(
					jPanel9Layout.createSequentialGroup().addContainerGap()
							.addComponent(jScrollPane3,
									javax.swing.GroupLayout.DEFAULT_SIZE, 503,
									Short.MAX_VALUE).addContainerGap()));

			jTabbedPane1.addTab("FAQ", jPanel9);

			jTextArea1.setColumns(20);
			jTextArea1.setRows(5);
			jTextArea1.setText(a.getChangelog());
			jScrollPane1.setViewportView(jTextArea1);

			jLabel15.setFont(new java.awt.Font("DejaVu Sans", 0, 24)); // NOI18N
			jLabel15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
			jLabel15.setText("[You: v" + a.getVersion() + "] - [Latest: v"
					+ a.getLatestVersion(false) + "]");

			final javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(
					jPanel7);
			jPanel7.setLayout(jPanel7Layout);
			jPanel7Layout
					.setHorizontalGroup(jPanel7Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									javax.swing.GroupLayout.Alignment.TRAILING,
									jPanel7Layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													jPanel7Layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.TRAILING)
															.addComponent(
																	jScrollPane1,
																	javax.swing.GroupLayout.Alignment.LEADING,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	815,
																	Short.MAX_VALUE)
															.addComponent(
																	jLabel15,
																	javax.swing.GroupLayout.Alignment.LEADING,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	815,
																	Short.MAX_VALUE))
											.addContainerGap()));
			jPanel7Layout
					.setVerticalGroup(jPanel7Layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									jPanel7Layout
											.createSequentialGroup()
											.addContainerGap()
											.addComponent(jLabel15)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
											.addComponent(
													jScrollPane1,
													javax.swing.GroupLayout.DEFAULT_SIZE,
													474, Short.MAX_VALUE)));

			jTabbedPane1.addTab("Changelog", jPanel7);

			start.setText("Start avianPro");
			start.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(final java.awt.event.ActionEvent evt) {
					Start(evt);
				}
			});

			jButton2.setIcon(new javax.swing.JLabel() {
				private static final long serialVersionUID = 3127706411443436962L;

				public javax.swing.Icon getIcon() {
					try {
						return new javax.swing.ImageIcon(
								new java.net.URL(
										"https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif"));
					} catch (final java.net.MalformedURLException e) {
					}
					return null;
				}
			}.getIcon());
			jButton2.setBorderPainted(false);
			jButton2.setFocusPainted(false);
			jButton2.setFocusable(false);
			jButton2.setMaximumSize(new java.awt.Dimension(92, 26));
			jButton2.setMinimumSize(new java.awt.Dimension(92, 26));
			jButton2.setOpaque(true);
			jButton2.setPreferredSize(new java.awt.Dimension(92, 26));
			jButton2.setRequestFocusEnabled(false);
			jButton2.setRolloverEnabled(false);
			jButton2.setVerifyInputWhenFocusTarget(false);
			jButton2.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(final java.awt.event.ActionEvent evt) {
					Donate(evt);
				}
			});

			final javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
					getContentPane());
			getContentPane().setLayout(layout);
			layout
					.setHorizontalGroup(layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									layout
											.createSequentialGroup()
											.addGroup(
													layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	layout
																			.createSequentialGroup()
																			.addContainerGap()
																			.addComponent(
																					jButton2,
																					javax.swing.GroupLayout.PREFERRED_SIZE,
																					javax.swing.GroupLayout.DEFAULT_SIZE,
																					javax.swing.GroupLayout.PREFERRED_SIZE)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED,
																					520,
																					Short.MAX_VALUE)
																			.addComponent(
																					jLabel1)
																			.addPreferredGap(
																					javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																			.addComponent(
																					jLabel2))
															.addGroup(
																	layout
																			.createSequentialGroup()
																			.addGap(
																					20,
																					20,
																					20)
																			.addComponent(
																					start)))
											.addContainerGap())
							.addGroup(
									layout
											.createSequentialGroup()
											.addComponent(
													jTabbedPane1,
													javax.swing.GroupLayout.DEFAULT_SIZE,
													940, Short.MAX_VALUE)
											.addGap(24, 24, 24)));
			layout
					.setVerticalGroup(layout
							.createParallelGroup(
									javax.swing.GroupLayout.Alignment.LEADING)
							.addGroup(
									layout
											.createSequentialGroup()
											.addContainerGap()
											.addGroup(
													layout
															.createParallelGroup(
																	javax.swing.GroupLayout.Alignment.LEADING)
															.addGroup(
																	layout
																			.createParallelGroup(
																					javax.swing.GroupLayout.Alignment.BASELINE)
																			.addComponent(
																					jLabel2)
																			.addComponent(
																					jLabel1))
															.addComponent(
																	jButton2,
																	javax.swing.GroupLayout.PREFERRED_SIZE,
																	javax.swing.GroupLayout.DEFAULT_SIZE,
																	javax.swing.GroupLayout.PREFERRED_SIZE))
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED)
											.addComponent(
													jTabbedPane1,
													javax.swing.GroupLayout.PREFERRED_SIZE,
													549,
													javax.swing.GroupLayout.PREFERRED_SIZE)
											.addPreferredGap(
													javax.swing.LayoutStyle.ComponentPlacement.RELATED,
													12, Short.MAX_VALUE)
											.addComponent(start)
											.addContainerGap()));

			pack();
		}// </editor-fold>

		private void Start(final ActionEvent evt) {
			cont = true;
			setVisible(false);
		}

		private void updatePriceCheck(final ActionEvent evt) {
			priceCheckWarn.setText(getPriceCheckState());
		}

		private void updateState(final ChangeEvent evt) {
			jLabel16.setText("State: " + getBoltState());
		}

	}

	private RSTile aviansieTile;
	private long start = System.currentTimeMillis();
	private final String[] config = new String[66];
	private final String[] defaultConfig = { "emereat:40", "paint:true",
			"boltpri:2", "gpgoal:5000", "logoutgoal:false", "runhours:2",
			"runminutes:0", "runenabled:false", "pricecheck:false",
			"checkxp:true", "pcwait:3", "pc1:50", "pc2:70", "xp1:20", "xp2:50",
			"eatr1:50", "eatr2:70", "anon:false", "teleat:15", "btp:16",
			"alch:true", "bury:true", "chaos:true", "ranarrs:false",
			"bolts:true", "laws:true", "airs:true", "clue:true",
			"swordfish:true", "waters:true", "bloods:true", "prayer:false",
			"prayr1:20", "prayr2:45", "prayat:6", "potions:false", "69:true",
			"71:true", "73:true", "79:true", "84:true", "89:true", "92:true",
			"94:true", "97:true", "137:false", "148:false" };
	private final String[][] customize = {
			{ "AvianHandleWaitInt1", "500", "500" },
			{ "CameraInt1", "50", "280" }, { "EnableRunInt1", "2000", "2200" },
			{ "AttackInt1", "500", "600" },
			{ "SpiritualInt1", "5000", "5500" },
			{ "DrinkInt1", "1500", "2000" },
			{ "CheckExpWaitInt1", "1000", "2500" },
			{ "FoodInt1", "500", "600" }, { "FoodInt2", "600", "1500" },
			{ "FoodInt3", "1100", "2000" }, { "BoneInt1", "1100", "2000" },
			{ "BoneInt2", "2500", "3000" }, { "DropJunkInt1", "500", "1000" },
			{ "Kree'ArraInt1", "15000", "20000" },
			{ "DropsInt1", "400", "900" }, { "DropsInt2", "800", "1000" },
			{ "PrayerInt1", "500", "1000" }, { "PrayerInt2", "1500", "2000" },
			{ "PrayerInt3", "1000", "1500" }, { "PotionsInt1", "700", "2000" },
			{ "PotionsInt2", "400", "600" } };
	private int[] aviansies;
	private final int[] eatRange = { 50, 70 };
	private final int[] prayerRange = { 20, 45 };
	private final int[] items = { 6883, 8015, 561, 554, 8013, 9185, 2570, 385,
			886, 884, 314, 7946 }; // peach btp nat fire home rcbow life shark
	// steelarrows ironarrows feathers monkfish
	private final int[] drops = { 2362, 9431, 5678, 526, 373, 565, 555 }; // bars
	// limbs
	// dagger
	// bones
	// swordfish
	// bloods
	// waters
	private final int[] dropsPriority = { 2362, 9431, 5678, 207, 565, 555, 373,
			561, 556, 562, 1249, 985, 563, 526 };
	private final int[] bolts = { 13280, 8882, 877, 9140, 9141, 13083, 9142,
			9143, 9144, 9340, 9243, 9341, 9244, 9338, 9241, 9342, 9245, 879,
			9236, 880, 9238, 9339, 9242, 9337, 9240, 9145, 9336, 9239, 881,
			4740 };
	private final int[] teleports = { 8013, 4251, 8011, 8010, 8009, 8008, 8007 };
	private final int[] gePrices = { -1, -1, -1, -1 };
	private final int[] junkIDs = { items[8], items[9], items[10], 1617, 687,
			1621, 1627, 1625, 1629, 1619, 1623, 863, 865, 40, 1137, 440, 807,
			2351, 7767, 7769, 1141, 808, 2353, 1539, 41, 229, 175, 442, 1462,
			314, 211, 215, 217, 199, 205, 209, 213, 2485, 201, 3051, 12174,
			203, 3049, 219 };
	private final int[] food = { 385, 7946, 373, 6883, 7060, 7054, 7056, 7058,
			6703, 6705, 2299, 2295, 2303, 2291, 2297, 2293, 2301, 2289, 1861,
			7068, 333, 7088, 315, 325, 329, 4291, 3144, 2343, 3381, 5988, 2140,
			7228, 2878, 7521, 7568, 4293, 2142, 3228, 319, 339, 13433, 347,
			355, 397, 391, 7198, 2323, 7188, 7178, 7190, 7180, 2331, 2333,
			7220, 7210, 2327, 7208, 379, 361, 6883 };
	private final int[] prayerStarted = { 0, 0, 0, 0 };
	private final int[] prayerPrice = { 2100, 4200, 6300, 8400 };
	private final int[] prayerPotions = { 143, 141, 139, 2434 };
	private final int[] rangePotions = { 173, 171, 169, 2444 };
	private final int[] defencePotions = { 137, 167, 135, 165, 133, 163, 2432,
			2442 };
	private final int[] potionRanges = { 0, 0 };
	private final int[] clueIDs = new int[] { 2677, 2678, 2679, 2680, 2681,
			2682, 2683, 2684, 2685, 2686, 2687, 2688, 2689, 2690, 2692, 2693,
			2694, 2695, 2696, 2697, 2698, 2699, 2700, 2701, 2702, 2703, 2704,
			2705, 2706, 2707, 2708, 2709, 2710, 2711, 2712, 2713, 2716, 2719,
			2722, 2723, 2725, 2727, 2729, 2731, 2733, 2735, 2737, 2739, 2741,
			2743, 2745, 2747, 2773, 2774, 2776, 2778, 2780, 2782, 2783, 2785,
			2786, 2788, 2790, 2792, 2793, 2794, 2796, 2797, 2799, 2801, 2803,
			2805, 2807, 2809, 2811, 2813, 2815, 2817, 2819, 2821, 2823, 2825,
			2827, 2829, 2831, 2833, 2835, 2837, 2839, 2841, 2843, 2845, 2847,
			2848, 2849, 2851, 2853, 2855, 2856, 2857, 2858, 3490, 3491, 3492,
			3493, 3494, 3495, 3496, 3497, 3498, 3499, 3500, 3501, 3502, 3503,
			3504, 3505, 3506, 3507, 3508, 3509, 3510, 3512, 3513, 3514, 3515,
			3516, 3518, 3520, 3522, 3524, 3525, 3526, 3528, 3530, 3532, 3534,
			3536, 3538, 3540, 3542, 3544, 3546, 3548, 3550, 3552, 3554, 3556,
			3558, 3560, 3562, 3564, 3566, 3568, 3570, 3572, 3573, 3574, 3575,
			3577, 3579, 3580, 3582, 3584, 3586, 3588, 3590, 3592, 3594, 3596,
			3598, 3598, 3599, 3601, 3602, 3604, 3605, 3607, 3609, 3610, 3611,
			3612, 3613, 3614, 3615, 3616, 3617, 3618, 7236, 7238, 7239, 7241,
			7243, 7245, 7247, 7248, 7249, 7250, 7251, 7252, 7253, 7254, 7255,
			7256, 7258, 7260, 7262, 7264, 7266, 7268, 7270, 7272, 7274, 7276,
			7278, 7280, 7282, 7284, 7286, 7288, 7290, 7292, 7294, 7296, 7298,
			7300, 7301, 7303, 7304, 7305, 7307, 7309, 7311, 7313, 7315, 7317,
			10180, 10182, 10184, 10186, 10188, 10190, 10192, 10194, 10196,
			10198, 10200, 10202, 10204, 10206, 10208, 10210, 10212, 10214,
			10216, 10218, 10220, 10222, 10224, 10226, 10228, 10230, 10232,
			10234, 10236, 10238, 10240, 10242, 10244, 10246, 10248, 10250,
			10252, 10254, 10256, 10258, 10260, 10262, 10264, 10266, 10268,
			10270, 10272, 10274, 10276, 10278, 13010, 13012, 13014, 13016,
			13018, 13020, 13022, 13024, 13026, 13028, 13030, 13032, 13034,
			13036, 13038, 13040, 13041, 13042, 13044, 13046, 13048, 13049,
			13050, 13051, 13053, 13055, 13056, 13058, 13060, 13061, 13063,
			13065, 13067, 13068, 13069, 13070, 13071, 13072, 13074, 13075,
			13076, 13078, 13079, 13080, 13058, 13060, 13061, 13063, 13065,
			13067, 13068, 13069, 13070, 13071, 13072, 13074, 13075, 13076,
			13078, 13079, 13080 };
	private final int[] antiBanSupport = { 0, 0 };
	private final double[][] antiBan = { { 0, -1, -1, 2, 0 }, { 0, -1, -1, 0 } };
	private RSNPC killingID = null, newTarget = null;
	private boolean pickup = false, alching = false, killing = false,
			show = false, newNPC = false, spiritual = false, bury = false,
			potions = false, prayer = false, waters1 = false, bloods1 = false,
			swordfish1 = false, bolts1 = false, laws1 = false, airs1 = false,
			clueScroll = false, moved = false, goalLogout = false,
			runEnabled = false, freezeScript = false, timeToLogGoal = false,
			timeToLogRun = false, ranarrs = false, chaos = false;
	final boolean skipSurvey = false;
	private int eat, btp, alch, loot = 0, emergencyEat = 40, tries = 0,
			startup = 1, tileTest = 0, potAt = 3, boltStarted = -1,
			boltPriority = 2, startxp = 0, teleAt = 15, boltQuantity = 0,
			goal = 0, runHours = 0, runMinutes = 0, startgp = 0, prayAt = 4,
			repaint = 0;
	private long hours = 0, minutes = 0;
	private double percentGoal = 0;

	private Config conf;

	private boolean activatePrayer() {
		return turnPrayer(19, true);
	}

	private void alch() {
		if (alch == 0 || getNPC() != null) {
			return;
		}

		final int[] toAlch = { 5678, 9431, 1294, 985 };
		if (alching) {
			for (final int i : toAlch) {
				final RSItem item = getInventoryItemByID(i);
				if (item == null) {
					continue;
				}
				if (getCurrentTab() != Constants.TAB_MAGIC) {
					openTab(Constants.TAB_MAGIC);
				}
				moveMouse(random(708, 725), random(315, 335));
				clickMouse(true);
				wait(random(400, 600));
				clickInventoryItem(i, true);
				wait(random(1400, 1600));
				if (getCurrentTab() != Constants.TAB_INVENTORY) {
					openTab(Constants.TAB_INVENTORY);
				}
			}
		}

		int count = 0;
		for (final int i : toAlch) {
			count += getInventoryCount(i);
		}
		if (count > 0) {
			alching = true;
		} else {
			alching = false;
		}
	}

	public boolean anonSurvey(final String mac) {
		if (skipSurvey) {
			return true;
		}
		try {
			final URL latest = new URL("http://www.rs2reborn.net/anon.php?a="
					+ mac + "&c=" + getMyPlayer().getCombatLevel());
			final BufferedReader in = new BufferedReader(new InputStreamReader(
					latest.openStream()));
			in.close();
		} catch (final Exception e) {
			return false;
		}
		return true;
	}

	public boolean atPriceChecker(final int itemID) {
		final int[] items = getInventoryArray();
		final java.util.List<Integer> possible = new ArrayList<Integer>();
		for (int i = 0; i < items.length; i++) {
			if (items[i] == itemID) {
				possible.add(i);
			}
		}
		if (possible.size() == 0) {
			return false;
		}
		final int idx = possible.get(random(0, possible.size()));
		final Point t = getInventoryItemPoint(idx);
		clickMouse(t, 5, 5, false);
		return atMenu("Add-All");
	}

	private void bone() {
		if (bury) {
			clickInventoryItem(drops[3], true);
			log("Buried Bones to make room.");
			wait(random(getSI("BoneInt1")[0], getSI("BoneInt1")[1]));
		} else {
			if (getCurrentTab() != Constants.TAB_INVENTORY) {
				openTab(Constants.TAB_INVENTORY);
			}
			atInventoryItem(drops[3], "Drop");
			log("Dropped Bones to make room.");
			wait(random(getSI("BoneInt1")[0], getSI("BoneInt1")[1]));
		}
	}

	private void checkForBones() {
		if (!prayer && getNPC() == null) {
			if (getInventoryCount(drops[3]) >= btp) {
				clickInventoryItem(items[1], true);
				log("Bones to Peaches tablet activated.");
				wait(random(getSI("BoneInt2")[0], getSI("BoneInt2")[1]));
				return;
			}
		}
	}

	public void checkRangeExp() {
		if (getCurrentTab() != Constants.TAB_STATS) {
			openTab(Constants.TAB_STATS);
		}
		wait(random(25, 150));
		moveMouse(random(557, 600), random(324, 347));
		wait(random(getSI("CheckExpWaitInt1")[0], getSI("CheckExpWaitInt1")[1]));
		openTab(Constants.TAB_INVENTORY);
		freezeScript = false;
		antiBan[1][3] = random(antiBan[1][1], antiBan[1][2]) / 500 * 1000 * 30;
	}

	private boolean clickCharacterCustom(final RSNPC npc, final String action) {
		try {
			final int hoverRand = random(8, 13);
			for (int i = 0; i < hoverRand; i++) {
				final Point screenLoc = npc.getScreenLocation();
				if (!pointOnScreen(screenLoc)) {
					setCameraRotation(getCameraAngle() + random(-35, 150));
					return false;
				}

				moveMouse(screenLoc, 6, 6);

				final List<String> menuItems = getMenuItems();
				if (menuItems.isEmpty() || menuItems.size() <= 1) {
					continue;
				}
				if (menuItems.get(0).toLowerCase().contains(
						npc.getName().toLowerCase())
						&& getNPC() == null) {
					clickMouse(true);
					return true;
				} else {
					for (int a = 1; a < menuItems.size(); a++) {
						if (menuItems.get(a).toLowerCase().contains(
								npc.getName().toLowerCase())
								&& getNPC() == null) {
							clickMouse(false);
							return atMenu(action);
						}
					}
				}
			}

		} catch (final Exception e) {
			e.printStackTrace();
			return false;
		}
		return false;
	}

	private boolean clickInventoryItem(final int itemID, final boolean click) { // Unknown
		// author
		if (getCurrentTab() != Constants.TAB_INVENTORY
				&& !RSInterface.getInterface(Constants.INTERFACE_BANK)
						.isValid()
				&& !RSInterface.getInterface(Constants.INTERFACE_STORE)
						.isValid()) {
			openTab(Constants.TAB_INVENTORY);
		}
		final int[] items = getInventoryArray();
		int slot = -1;
		for (int i = 0; i < items.length; i++) {
			if (items[i] == itemID) {
				slot = i;
				break;
			}
		}
		if (slot == -1) {
			return false;
		}
		final Point t = getInventoryItemPoint(slot);
		clickMouse(t, 5, 5, click);
		return true;
	}

	private boolean clickPrayer(final int prayID) {
		int PrayX = 569;
		int PrayY = 233;
		if (prayID == 2 || prayID == 7 || prayID == 12 || prayID == 17
				|| prayID == 22 || prayID == 27) {
			PrayX += 39;
		}
		if (prayID == 3 || prayID == 8 || prayID == 13 || prayID == 18
				|| prayID == 23) {
			PrayX += 39 * 2;
		}
		if (prayID == 4 || prayID == 9 || prayID == 14 || prayID == 19
				|| prayID == 24) {
			PrayX += 39 * 3;
		}
		if (prayID == 5 || prayID == 10 || prayID == 15 || prayID == 20
				|| prayID == 25) {
			PrayX += 39 * 4;
		}

		if (prayID > 5) {
			PrayY += 37;
		}
		if (prayID > 10) {
			PrayY += 37;
		}
		if (prayID > 15) {
			PrayY += 37;
		}
		if (prayID > 20) {
			PrayY += 37;
		}
		if (prayID > 25) {
			PrayY += 37;
		}

		if (getCurrentTab() != Constants.TAB_PRAYER) {
			openTab(Constants.TAB_PRAYER);
		}
		wait(random(300, 500));
		clickMouse(PrayX, PrayY, 5, 5, true);
		return true;
	}

	private int defencePotionCount() {
		int i = 0;
		final int[] items = getInventoryArray();
		for (final int i1 : items) {
			for (final int i2 : defencePotions) {
				if (i1 == i2) {
					i++;
				}
			}
		}
		return i;
	}

	private int defencePotionItem() {
		final int[] items = getInventoryArray();
		for (final int i : items) {
			for (final int i1 : defencePotions) {
				if (i == i1) {
					return i1;
				}
			}
		}
		return -1;
	}

	public void doAntiBan(final String anti, final String method) {
		log("avianPro: Anti-ban `" + anti + "` by Hidendra activated.");

		if (method.equals("price")) {
			priceChecker();
		} else if (method.equals("rangexp")) {
			checkRangeExp();
		}

		log("avianPro: Anti-ban `" + anti + "` by Hidendra completed.");
	}

	private boolean doDrops() {
		boolean found = false;

		if (clueScroll) {
			for (final int i : clueIDs) {
				final RSTile clue = getClosestGroundItemByID(10, i);
				if (clue == null) {
					continue;
				}
				if (!clue.isValid()) {
					continue;
				}

				found = true;

				while (!tileOnScreen(clue) && !getMyPlayer().isMoving()) {
					walkTileMM(randomizeTile(clue, 2, 2));
					wait(random(getSI("DropsInt1")[0], getSI("DropsInt1")[1]));
				}

				if (isInventoryFull()) {
					food(true);
				}

				if (atTile(clue, "Clue") && !isInventoryFull()) {
					log("Picked up a Clue Scroll");
					loot++;
					wait(random(getSI("DropsInt2")[0], getSI("DropsInt2")[1]));
				}
			}
		}

		if (bolts1) {
			for (final int i : bolts) {
				if (killingID != null) {
					if (killingID.isValid()) {
						if (getNPC() != null || killingID.getHPPercent() > 0
								&& killingID.isInCombat()) {
							return true;
						}
					}
				}
				if (i != boltStarted) {
					continue;
				}

				final RSTile bolt = getClosestGroundItemByID(15, boltStarted);
				if (bolt == null) {
					continue;
				}
				if (!bolt.isValid()) {
					continue;
				}

				if (boltPriority == 3 && isInventoryFull()) {
					continue;
				}
				if (boltPriority == 2 && isInventoryFull()) {
					forceEatNoSharks();
				}
				if (boltPriority == 1 && isInventoryFull()) {
					food(true);
				}

				found = true;
				pickup = true;

				while (!tileOnScreen(bolt) && !getMyPlayer().isMoving()) {
					walkTileMM(randomizeTile(bolt, 2, 2));
					wait(random(getSI("DropsInt1")[0], getSI("DropsInt1")[1]));
				}

				if (atTile(bolt, "bolt")) {
					log("Picked up Bolts");
					loot++;
					wait(random(getSI("DropsInt2")[0], getSI("DropsInt2")[1]));
					return false;
				}

			}
		}

		for (final int i : dropsPriority) {
			if (killingID != null) {
				if (killingID.isValid()) {
					if (getNPC() != null && i != 2361) {
						return true;
					}
				}
			}

			boolean stack = false;
			RSItemTile drop = null;

			if (i == 555 && !waters1) {
				continue;
			}
			if (i == 565 && !bloods1) {
				continue;
			}
			if (i == 373 && !swordfish1) {
				continue;
			}
			if (i == 556 && !airs1) {
				continue;
			}
			if (i == 563 && !laws1) {
				continue;
			}
			if (i == 207 && !ranarrs) {
				continue;
			}
			if (i == 562 && !chaos) {
				continue;
			}
			if ((i == 561 || i == 9431 || i == 5678) && alch == 0) {
				continue;
			}
			if (i == 555 || i == 565 || i == 561 || i == 556 || i == 563
					|| i == 562 || i == 2362) {
				stack = true;
			}
			if ((i == 373 || i == 526) && prayer) {
				continue;
			}

			if (i == 2362 || i == 9431 || i == 5678) {
				drop = getClosestGroundItemByID(18, i);
			} else {
				drop = getClosestGroundItemByID(5, i);
			}

			if (drop == null) {
				continue;
			}

			if (!drop.isValid()) {
				continue;
			}

			if (i == 373 && isInventoryFull()) {
				doSwordfishes();
				return false;
			}
			if (i == 526 && isInventoryFull()) {
				continue;
			}
			if (stack && isInventoryFull() && getInventoryCount(i) == 0) {
				if (!food(true)) {
					return false;
				}
			}
			if (!stack && isInventoryFull()) {
				if (!food(true)) {
					return false;
				}
			}

			found = true;
			pickup = true;

			if (getMyPlayer().isMoving()) {
				return false;
			}

			while (!tileOnScreen(drop) && !getMyPlayer().isMoving()) {
				walkTileMM(randomizeTile(drop, 2, 2));
				wait(random(getSI("DropsInt1")[0], getSI("DropsInt1")[1]));
			}

			if (atTile(drop, getItemNameProper(i)) && getInventoryCount(i) > 0
					&& stack) {
				log("Picked up " + getItemName(i));
				loot++;
				wait(random(getSI("DropsInt2")[0], getSI("DropsInt2")[1]));
				return false;
			} else {
				wait(random(200, 500));
			}

			if (atTile(drop, getItemNameProper(i)) && !isInventoryFull()
					&& !stack) {
				log("Picked up " + getItemName(i));
				loot++;
				wait(random(getSI("DropsInt2")[0], getSI("DropsInt2")[1]));
				return false;
			} else {
				wait(random(200, 500));
			}

			return false;
		}

		if (!found) {
			if (pickup) {
				pickup = false;
			}
			return true;
		}

		return false;

	}

	private void doPotions() {
		if (prayer) {
			if (!activatePrayer() && !rangePrayerActivated()) {
				if (skills.getCurrentSkillLevel(Skills.getStatIndex("prayer")) == 0) {
					log("No prayer left.. checking pots, if some left sipping and if not teleporting.");
					if (prayerPotionCount() == 0) {
						log("No prayer potions are left. Teleporting now.");
						getOut(false);
					} else {
						log("There are still "
								+ prayerPotionCount()
								+ " Prayer Potions left... Lets take two sips and reactivate prayer.");
						clickInventoryItem(prayerPotionItem(), true);
						wait(random(getSI("PrayerInt1")[0],
								getSI("PrayerInt1")[1]));
						clickInventoryItem(prayerPotionItem(), true);
						wait(random(getSI("PrayerInt2")[0],
								getSI("PrayerInt2")[1]));
						activatePrayer();
						if (getCurrentTab() != Constants.TAB_INVENTORY) {
							openTab(Constants.TAB_INVENTORY);
						}
					}
				} else {
					log("PrayerError: Restart the script and if you get this again report it in the thread.");
				}
			}
			if (skills.getCurrentSkillLevel(Skills.getStatIndex("prayer")) <= potAt
					&& getNPC() == null) {
				potAt = random(prayerRange[0], prayerRange[1]);
				if (prayerPotionCount() > 0) {
					clickInventoryItem(prayerPotionItem(), true);
					wait(random(getSI("PrayerInt3")[0], getSI("PrayerInt3")[1]));
					log("Took a sip of a Prayer Potion. We now have "
							+ prayerPotionCount()
							+ " Prayer Potions left. Next drinking at " + potAt
							+ " prayer");
				} else {
					log("We are out of Prayer Potions. Time to teleport.");
					getOut(false);
					return;
				}
			}
			if (skills.getCurrentSkillLevel(Skills.getStatIndex("prayer")) <= prayAt) {
				potAt = random(prayerRange[0], prayerRange[1]);
				if (prayerPotionCount() > 0) {
					clickInventoryItem(prayerPotionItem(), true);
					wait(random(getSI("PrayerInt3")[0], getSI("PrayerInt3")[1]));
					log("Took a sip of a Prayer Potion. We now have "
							+ prayerPotionCount()
							+ " Prayer Potions left. Next drinking at " + potAt
							+ " prayer");
				} else {
					log("We are out of Prayer Potions. Time to teleport.");
					getOut(false);
					return;
				}
			}
		}

		if (potions) {
			final int currentRange = skills.getCurrentSkillLevel(Skills
					.getStatIndex("range")), currentDefence = skills
					.getRealSkillLevel(Skills.getStatIndex("defence"));

			if (rangePotionCount() > 0) {
				if (currentRange <= getPotionRange(true)) {
					if (getCurrentTab() != Constants.TAB_STATS) {
						openTab(Constants.TAB_STATS);
					}
					wait(random(getSI("PotionsInt1")[0],
							getSI("PotionsInt1")[1]));
					clickInventoryItem(rangePotionItem(), true);
					wait(random(getSI("PotionsInt2")[0],
							getSI("PotionsInt2")[1]));
					log("Took a sip of a Range Potion.");
					newPotionRange(true);
				}
			}

			if (defencePotionCount() > 0) {
				if (currentDefence <= getPotionRange(false)) {
					if (getCurrentTab() != Constants.TAB_STATS) {
						openTab(Constants.TAB_STATS);
					}
					wait(random(getSI("PotionsInt1")[0],
							getSI("PotionsInt1")[1]));
					clickInventoryItem(defencePotionItem(), true);
					wait(random(getSI("PotionsInt2")[0],
							getSI("PotionsInt2")[1]));
					log("Took a sip of a Defence Potion.");
					newPotionRange(false);
				}
			}
		}
	}

	private void doSwordfishes() {
		final RSTile ti = getClosestGroundItemByID(5, 373);
		final RSItemTile[] tile = getGroundItemsAt(ti.getX(), ti.getY());
		int count = 0, started = 0;
		for (final RSItemTile t : tile) {
			if (t.getItem().getID() == 373) {
				count++;
			}
		}
		started = getInventoryCount() - count;
		while (count > 0) {
			if (getInventoryCount() - started == count) {
				forceEatNoSharks();
			}
			count--;
		}
	}

	private void dropJunkItems() {
		if (getNPC() != null || getMyPlayer().isInCombat()) {
			return;
		}

		for (final RSItem i : getInventoryItems()) {
			if (i == null) {
				continue;
			}

			for (final int i1 : junkIDs) {
				if (i.getID() == i1) {
					if (getCurrentTab() != Constants.TAB_INVENTORY) {
						openTab(Constants.TAB_INVENTORY);
					}
					log("Dropping Junk Items.");
					atInventoryItem(i1, "Drop");
					wait(random(getSI("DropJunkInt1")[0],
							getSI("DropJunkInt1")[1]));
				}
			}
			for (final int i2 : bolts) {
				if (i.getID() == i2 && i2 != boltStarted && i2 != -1) {
					if (getCurrentTab() != Constants.TAB_INVENTORY) {
						openTab(Constants.TAB_INVENTORY);
					}
					log("Dropping foreign Bolts");
					atInventoryItem(i2, "Drop");
					wait(random(getSI("DropJunkInt1")[0],
							getSI("DropJunkInt1")[1]));
				}
			}
			if (i.getID() == boltStarted && boltStarted != -1) {
				if (getCurrentTab() != Constants.TAB_INVENTORY) {
					openTab(Constants.TAB_INVENTORY);
				}
				log("Equipping Bolts.");
				clickInventoryItem(boltStarted, true);
				wait(random(getSI("DropJunkInt1")[0], getSI("DropJunkInt1")[1]));
			}

		}
	}

	private boolean food(final boolean flag) {
		if (skills.getCurrentSkillLevel(3) <= eat && !flag && getNPC() == null) {
			for (final int i : food) { // we want to eat the good food first..
				if (getInventoryCount(i) == 0) {
					continue;
				}
				clickInventoryItem(i, true);
				log("Ate food.");
				wait(random(getSI("FoodInt1")[0], getSI("FoodInt1")[1]));
				newHP();
				wait(random(getSI("FoodInt2")[0], getSI("FoodInt2")[1]));
				return true;
			}
		}
		if (!flag && getNPC() != null
				&& skills.getCurrentSkillLevel(3) <= emergencyEat) {
			for (final int i : food) { // we want to eat the good food first..
				if (getInventoryCount(i) == 0) {
					continue;
				}
				clickInventoryItem(i, true);
				log("Ate food.");
				wait(random(getSI("FoodInt1")[0], getSI("FoodInt1")[1]));
				newHP();
				wait(random(getSI("FoodInt2")[0], getSI("FoodInt2")[1]));
				return true;
			}
		}
		if (flag) {

			if (getInventoryCount(drops[1]) > 0
					|| getInventoryCount(drops[2]) > 0) {
				alch();
				return true;
			}

			if (getInventoryCount(drops[3]) > 0) { // we found the bone
				bone();
				return true;
			}
			for (int i = food.length - 1; i >= 0; i--) { // go through the food
				// array in
				// reverse-order to
				// ensure crappy
				// food > good
				// food..
				if (getInventoryCount(food[i]) == 0) {
					continue;
				}
				clickInventoryItem(food[i], true);
				log("Force ate a piece of food to make room.");
				wait(random(getSI("FoodInt3")[0], getSI("FoodInt3")[1]));
				return true;
			}

		}
		return false;
	}

	private boolean forceEatNoSharks() {
		if (getInventoryCount(drops[1]) > 0 || getInventoryCount(drops[2]) > 0) {
			alch();
			return true;
		}
		if (getInventoryCount(drops[3]) > 0) {
			bone();
			return true;
		}
		for (int i = food.length - 1; i >= 0; i--) {
			if (food[i] == 385 || getInventoryCount(food[i]) == 0) {
				// want to
				// eat a
				// shark
				// just to
				// make room
				// for a
				// Swordfish....
				// lawl
				continue;
			}
			clickInventoryItem(food[i], true);
			log("Force ate a piece of food to make room.");
			wait(random(getSI("FoodInt3")[0], getSI("FoodInt3")[1]));
			return true;
		}
		return false;
	}

	@Override
	public String getAuthor() {
		return "Hidendra";
	}

	private int getBoltID() {
		final int[] items = getEquipmentArray();
		for (final int item : items) {
			for (final int i : bolts) {
				if (item == i) {
					return item;
				}
			}
		}
		return -1;
	}

	public String getChangelog() {
		String input = "", change = "";
		try {
			final URL latest = new URL(
					"http://www.rs2reborn.net/changelogs/avianpro");
			final BufferedReader in = new BufferedReader(new InputStreamReader(
					latest.openStream()));
			while ((input = in.readLine()) != null) {
				change += input + " \n";
			}
			in.close();
		} catch (final MalformedURLException e) {
			e.printStackTrace();
		} catch (final IOException e) {
			e.printStackTrace();
		}
		return change;
	}

	public RSItemTile getClosestGroundItemByID(final int _range, final int id) { // temporary
		// until
		// if/when
		// my
		// method
		// gets
		// added
		// to
		// RSBot.
		int range = _range;
		RSItemTile closest = null;
		final int pX = getMyPlayer().getLocation().getX();
		final int pY = getMyPlayer().getLocation().getY();
		final int minX = pX - range;
		final int minY = pY - range;
		final int maxX = pX + range;
		final int maxY = pY + range;
		for (int x = minX; x <= maxX; x++) {
			for (int y = minY; y <= maxY; y++) {
				final RSItemTile[] items = getGroundItemsAt(x, y);
				for (final RSItemTile item : items) {
					final int iId = item.getItem().getID();
					if (iId == id) {
						if (distanceTo(item) <= range) {
							closest = item;
							range = distanceTo(item);
							continue;
						}
					}
				}
			}
		}
		return closest;
	}

	public String getConfig(final String name) {
		for (final String x : config) {
			if (x == null) {
				break;
			}
			final String x1[] = x.split(":");
			if (x1[0].equals(name)) {
				return x1[1];
			}
		}
		for (final String def : defaultConfig) {
			final String def1[] = def.split(":");
			if (def1[0].equals(name)) {
				return def1[1];
			}
		}
		return "Unknown";
	}

	public String getConfigBool(final String name) {
		for (final String x : config) {
			if (x == null) {
				break;
			}
			final String x1[] = x.split(":");
			if (x1[0].equals(name)) {
				return x1[1].equals("true") ? "CHECKED" : "";
			}
		}
		for (final String def : defaultConfig) {
			final String def1[] = def.split(":");
			if (def1[0].equals(name)) {
				return def1[1].equals("true") ? "CHECKED" : "";
			}
		}
		return "Unknown";
	}

	public String getFAQ() {
		String input = "", change = "";
		try {
			final URL latest = new URL("http://www.rs2reborn.net/faqs/avianpro");
			final BufferedReader in = new BufferedReader(new InputStreamReader(
					latest.openStream()));
			while ((input = in.readLine()) != null) {
				change += input + " \n";
			}
			in.close();
		} catch (final MalformedURLException e) {
			e.printStackTrace();
		} catch (final IOException e) {
			e.printStackTrace();
		}
		return change;
	}

	private String getItemName(final int name) {
		switch (name) {

		case 2362:
			return "4 Adamantite Bars";

		case 9431:
			return "Runite Limbs";

		case 5678:
			return "a Rune Dagger(p+)";

		case 565:
			return "Blood Runes";

		case 555:
			return "Water Runes";

		case 373:
			return "a Swordfish";

		case 561:
			return "Nature Runes";

		case 556:
			return "Air Runes";

		case 563:
			return "Law Runes";

		case 562:
			return "Chaos Runes";

		case 207:
			return "Ranarr";

		case 526:
			return "Bones";

		default:
			return "an Unknown item";
		}
	}

	private String getItemNameProper(final int name) {
		switch (name) {

		case 2362:
			return "Take Adamantite bar";

		case 9431:
			return "Take Runite limbs";

		case 5678:
			return "Take Rune dagger(p+)";

		case 565:
			return "Take Blood rune";

		case 555:
			return "Take Water rune";

		case 373:
			return "Take Swordfish";

		case 561:
			return "Take Nature rune";

		case 556:
			return "Take Air rune";

		case 563:
			return "Take Law rune";

		case 562:
			return "Take Chaos rune";

		case 207:
			return "Take Grimy ranarr";

		case 526:
			return "Take Bones";

		default:
			return "an Unknown item";
		}
	}

	public String getLatestVersion(final boolean flag) {
		String input = "", suffix = "";
		double version = 0.00;
		try {
			final URL latest = new URL("http://www.rs2reborn.net/latest");
			final BufferedReader in = new BufferedReader(new InputStreamReader(
					latest.openStream()));

			while ((input = in.readLine()) != null) {
				version = Double.parseDouble(input);
				if (version > getVersion()) {
					suffix = "  <font color='red'>You are not using the latest version of this script! Please update via http://www.rs2reborn.net/avianProHidendra.java</font>";
				}
				if (version < getVersion()) {
					suffix = "  You are using an overdated version?";
				}
				if (version == getVersion()) {
					suffix = "  <font color='green'>You are up to date!</font>";
				}
			}
			in.close();

		} catch (final MalformedURLException e) {
			e.printStackTrace();

		} catch (final IOException e) {
			e.printStackTrace();
		}

		if (flag) {
			return "<font color='blue'>" + version + "</font>" + suffix;
		} else {
			return version + "";
		}
	}

	@Override
	public String getName() {
		return "avianPro";
	}

	private RSCharacter getNPC() {
		try {
			return getMyPlayer().getInteracting();
		} catch (final ArrayIndexOutOfBoundsException e) {
			return null;
		}
	}

	private void getOut(final boolean flag) {
		int c = 0;
		for (final int i : food) {
			c += getInventoryCount(i);
		}
		if (!flag) {
			log("Last resort measures activated. Now teleporting and leaving.");
			clickInventoryItem(getTeleportID(), true);
			wait(random(getSI("Kree'ArraInt1")[0], getSI("Kree'ArraInt1")[1]));
			stopAllScripts();
			return;
		} else {
			if (getInventoryCount(drops[3]) > 2) {
				c += getInventoryCount(drops[3]);
				clickInventoryItem(items[1], true);
				log("Bones to Peaches tablet activated.");
				wait(random(getSI("BoneInt2")[0], getSI("BoneInt2")[1]));
			}
			if (c > 0) {
				while (skills.getCurrentSkillLevel(3) <= emergencyEat) {
					if (c == 0) {
						if (getInventoryCount(drops[3]) > 2) {
							c += getInventoryCount(drops[3]);
							clickInventoryItem(items[1], true);
							log("Bones to Peaches tablet activated.");
							wait(random(getSI("BoneInt2")[0],
									getSI("BoneInt2")[1]));
						} else {
							break;
						}
					}
					if (food(false)) {
						c--;
					}
				}

			}
			if (c == 0) {
				log("Last resort measures activated. Now teleporting and leaving.");
				if (getCurrentTab() != Constants.TAB_INVENTORY) {
					openTab(Constants.TAB_INVENTORY);
				}
				wait(100);
				clickInventoryItem(getTeleportID(), true);
				wait(random(getSI("Kree'ArraInt1")[0],
						getSI("Kree'ArraInt1")[1]));
				stopAllScripts();
				return;
			}
		}
	}

	public int getPotionRange(final boolean flag) {
		return potionRanges[flag == true ? 0 : 1];
	}

	private int getProfit() {
		return getInventoryCount(995) + getInventoryCount(drops[0])
				* gePrices[0] + getInventoryCount(drops[5]) * gePrices[1]
				+ getInventoryCount(drops[6]) * gePrices[2]
				- (boltQuantity - getEquipmentCount(boltStarted)) * gePrices[3];
	}

	private int getProfitPrayer() {
		int total = 0;
		for (int i = 0; i < prayerPrice.length; i++) {
			total += prayerPrice[i] * prayerStarted[i];
		}
		return getProfit() - total
				- (boltQuantity - getEquipmentCount(boltStarted)) * gePrices[3];
	}

	@Override
	public String getScriptCategory() {
		return "Combat";
	}

	@Override
	public String getScriptDescription() {
		String send = " <html> <head> <style> body {text-align:center; background-color: black; color: white;} h2 {text-align:right; color: red;} </style> </head> <body> <h2>avianPro v"
				+ getVersion() + " <br/> Author: Hidendra</h2> <br/>";
		send += " <i><font color='lime'>\"</font>It could reach a point where macro software becomes undetectable.<font color='lime'>\"</font></i>  <b>-Andrew Gower</b><br/> ";
		send += " Latest version: " + getLatestVersion(true) + " <br/><br/>  ";
		send += " If you loved my sript, or just want to support Hidendra, consider donating. To do so you can click the `Donate` button in the Config GUI upon starting the script. Thank you. <br/> <br/><br/>";
		send += " Main thread: <font color='lime'>http://www.rsbot.org/vb/showthread.php?t=27580</font> <br/> <br/> ";
		return send;
	}

	public String getSetting(final String id) {
		for (final String x : config) {
			if (x == null) {
				break;
			}
			final String x1[] = x.split(":");
			if (x1[0].equals(id)) {
				return x1[1] + ":" + x1[2];
			}
		}
		for (final String[] x2 : customize) {
			if (x2[0] == null) {
				break;
			}
			if (x2[0].equals(id)) {
				return x2[1] + ":" + x2[2];
			}
		}
		return "UNKNOWN";
	}

	public int[] getSI(final String id) {
		final int[] setting = new int[2];
		for (final String possible : config) {
			if (possible == null) {
				continue;
			}
			final String[] x = possible.split(":");
			if (x[0].equals(id)) {
				setting[0] = Integer.parseInt(x[1]);
				setting[1] = Integer.parseInt(x[2]);
				return setting;
			}
		}
		return new int[2];
	}

	private int getTeleportID() {
		final int[] items = getInventoryArray();
		for (final int item : items) {
			for (final int i : teleports) {
				if (item == i) {
					return item;
				}
			}
		}
		return -1;
	}

	@Override
	public double getVersion() {
		return 1.21;
	}

	private double gpHour() {
		final double hours1 = (double) hours;
		double minutes1 = (double) minutes;
		if (minutes1 == 0 && hours1 == 0) {
			return 0;
		}
		if (hours1 > 0) {
			minutes1 = minutes1 + hours1 * 60;
		}
		return Math.round((getProfit() - startgp) * 60 / minutes1);
	}

	public void loadConfiguration() {
		try {
			String x = "";
			final BufferedReader in = new BufferedReader(new InputStreamReader(
					new DataInputStream(new FileInputStream(
							"Settings/avianProConfig.txt"))));

			while ((x = in.readLine()) != null) {

				for (int i = 0; i < config.length; i++) {
					if (config[i] == null) {
						config[i] = x;
						break;
					}
				}

			}
		} catch (final IOException e) {
		}
	}

	public void loadDefaultConfig() {
		for (int i = 0; i < defaultConfig.length; i++) {
			config[i] = defaultConfig[i];
		}
		for (int i = 0; i < customize.length; i++) {
			config[defaultConfig.length + i] = customize[i][0] + ":"
					+ customize[i][1] + ":" + customize[i][2];
		}
	}

	public void logout(final String message) {
		log(message);
		wait(random(getSI("Kree'ArraInt1")[0], getSI("Kree'ArraInt1")[1]));
		stopAllScripts();
	}

	@Override
	public int loop() {
		while (!isLoggedIn()
				|| RSInterface.getInterface(378).getChild(45).getAbsoluteX() > 20
				|| !RSInterface.getInterface(378).getChild(117).getText()
						.equals("10.1120.190")
				&& !RSInterface.getInterface(378).getChild(117).getText()
						.equals("")) {
			return random(120, 300);
		}
		if (freezeScript) {
			freezeScript = false;

			if (antiBanSupport[0] == 1 && (int) antiBan[0][4] == 0) {
				if (!doDrops() || !getMyPlayer().isInCombat()) {
					return random(100, 800);
				}
				doAntiBan("Price Checker", "price");
				antiBanSupport[0] = 0;
				return random(100, 800);
			}

			if (antiBanSupport[1] == 1 && (int) antiBan[1][3] == 0) {
				doAntiBan("Range Exp Check", "rangexp");
				antiBanSupport[1] = 0;
				return random(100, 800);
			}

			if (timeToLogGoal && doDrops() && !getMyPlayer().isInCombat()) {
				logout("We have reached our goal of " + goal
						+ "k. Time to logout.");
			} else {
				return random(100, 800);
			}

			if (timeToLogRun && doDrops() && !getMyPlayer().isInCombat()) {
				logout("We have run for a total of " + hours + " hours and "
						+ minutes + " minutes. Time to logout.");
			} else {
				return random(100, 800);
			}
		}

		if (startup == 1) {
			if (isLoggedIn()) {

				if (!getConfig("anon").equals("true")) {
					String macSha = "";

					try {
						final java.util.Enumeration<?> eth = java.net.NetworkInterface
								.getNetworkInterfaces();
						while (eth.hasMoreElements()) {
							final java.net.NetworkInterface eth0 = (java.net.NetworkInterface) eth
									.nextElement();
							final byte mac[] = eth0.getHardwareAddress();
							if (mac != null) {
								for (int i2 = 0; i2 < mac.length; i2++) {
									macSha += String.format("%02X%s", mac[i2],
											i2 < mac.length - 1 ? "-" : "");
								}
								break;
							}
						}
					} catch (final Exception e) {
					}

					if (!macSha.equals("")) {
						if (anonSurvey(macSha)) {
							setConfig("anon", "true");
						}
					}
				}

				if (alch == 1 && inventoryContains(items[2])
						&& inventoryContains(items[3])) {
					log("We can alch.");
				} else {
					if (alch == 1) {
						log("No natures or fires found. We can't alch this trip, not picking up daggers or limbs.");
					} else {
						log("Alching is disabled, so we will not alch at all.");
					}
					if (alch == 1) {
						alch = 0;
					}
				}

				if (getTeleportID() != -1) {
					log("Found a Teleport Tablet or an Ectophial.");
				} else {
					log("No usable Teleport found. Script cannot continue as it is not safe. Please get a Teleport tablet or an Ectophial.");
					stopAllScripts();
					return 1;
				}

				if (!prayer) {
					if (getInventoryCount(items[1]) > 0) {
						log("Found " + getInventoryCount(items[1])
								+ " Bones to Peaches tablets.");
					} else {
						log("No Bones to Peaches tablets found. Script cannot continue!");
						stopAllScripts();
						return 1;
					}
				}

				if (prayer) {
					if (prayerPotionCount() > 0) {
						potAt = random(prayerRange[0], prayerRange[1]);
						log("We have "
								+ prayerPotionCount()
								+ " Prayer Potions currently. Next drinking at "
								+ potAt + " prayer");
					} else {
						log("Prayer mode is activated, but no Prayer Potions found in your inventory. Stopping script.");
						stopAllScripts();
					}
				}

				if (potions) {
					if (rangePotionCount() == 0 && defencePotionCount() == 0) {
						log("No range or defence potions found, but potions are activated. No point in wasting cpu; deactiving potions.");
						potions = true;
					}
				}

				double range = skills.getRealSkillLevel(Skills
						.getStatIndex("Range"));
				double range1 = skills.getRealSkillLevel(Skills
						.getStatIndex("Defence"));
				range = range + Math.round(range * .15 / 2);
				range1 = range1 + Math.round(range1 * .15 / 2);
				potionRanges[0] = (int) range;
				potionRanges[1] = (int) range1;
				newHP();
				if (random(0, 3) == 1) {
					setCameraRotation(random(getSI("CameraInt1")[0],
							getSI("CameraInt1")[1]));
					log("Rotating camera.");
				} else {
					setCameraAltitude(true);
					log("Moving camera up.");
				}
				newNPC = true;
				if (boltStarted == -1) {
					boltStarted = getBoltID();
					boltQuantity = getEquipmentCount(boltStarted);
					gePrices[3] = grandExchange.loadItemInfo(boltStarted)
							.getMarketPrice();
				}
				start = System.currentTimeMillis();
				startxp = skills.getCurrentSkillExp(Skills
						.getStatIndex("range"));
				startgp = getProfit();
				startup = 0;
			}
			return random(200, 300);
		}
		if (newTarget == null) {
			newTarget = getNearestFreeNPCByID(aviansies);
		}
		if (newTarget != null) {
			if (newTarget.isValid()) {
				if (newTarget.isInCombat()
						|| !pointOnScreen(newTarget.getScreenLocation())) {
					newTarget = getNearestFreeNPCByID(aviansies);
				}
			}
		}

		if (food(false)) {
			return random(250, 500);
		}
		if (skills.getCurrentSkillLevel(3) <= teleAt) {
			getOut(false);
		}
		if (!spiritual) {
			dropJunkItems();
			checkForBones();
			doPotions();
			alch();
		}
		if (!isRunning()) {
			setRun(true);
			wait(random(getSI("EnableRunInt")[0], getSI("EnableRunInt")[1]));
		}
		if (!doDrops()) {
			return random(getSI("DropsInt1")[0], getSI("DropsInt1")[1]);
		}
		if (tries == 3) {
			log("We attempted to attack the Aviansie enough times...");
			newNPC = true;
			tries = 0;
		}
		if (skills.getCurrentSkillLevel(3) <= emergencyEat && !prayer) {
			getOut(true);
		}
		if (skills.getCurrentSkillLevel(3) < 30 && prayer) {
			if (prayerPotionCount() == 0) {
				log("Warning: Out of prayer potions and low HP...");
				getOut(false);
			} else {
				clickInventoryItem(prayerPotionItem(), true);
				wait(random(getSI("DrinkInt1")[0], getSI("DrinkInt1")[1]));
				log("Took a sip of a Prayer Potion. We now have "
						+ prayerPotionCount()
						+ " Prayer Potions left. Next drinking at " + potAt
						+ " prayer");
			}
			activatePrayer();
		}

		if (getInventoryCount(items[5]) > 0 && !spiritual) {
			log("Was rune cbow unequipped via alch??");
			clickInventoryItem(items[5], true);
			wait(random(500, 1000));
		}

		if (killingID != null && !pickup) {
			if (killingID.isInCombat() && !getMyPlayer().isInCombat()) {
				newNPC = true;
			}
		}
		if (newNPC) {
			killingID = getNearestFreeNPCByID(aviansies);
			killing = true;
			newNPC = false;
		}
		if (spiritual) { // needs to be perfected l0l
			if (tileTest == 0) {
				tileTest = 1;
			}

			if (tileTest == 1 && !getMyPlayer().isMoving()) {
				setCameraRotation(269);
				moveMouse(random(610, 628), random(25, 40));
				clickMouse(true);
				wait(random(getSI("SpiritualInt1")[0],
						getSI("SpiritualInt1")[1]));
				log("Spiritual possibly evaded.");
				spiritual = false;
			}
		}

		if (getNPC() != null) {
			if (getNPC().isValid()) {
				if (getNPC().getLocation() != aviansieTile) {
					aviansieTile = getNPC().getLocation();
				}
				if (!moved) {
					moved = false;
				}
				if (tries > 0) {
					tries = 0;
				}
			}
		}

		if (getNPC() != null) {
			if (getNPC().isValid()) {
				if (getNPC().getHPPercent() == 0 && getMyPlayer().isInCombat()) {
					int waited = 0;
					while (aviansieTile != null && distanceTo(aviansieTile) > 4
							&& !getMyPlayer().isMoving() && !moved) {
						waited++;
						if (walkTileMM(randomizeTile(aviansieTile, 3, 3))) {
							aviansieTile = null;
						}
					}
					tries = 0;
					newNPC = true;
					return random(1800 - waited, 2100 - waited);
				}
			}
		}

		if (killingID != null) {
			if (!killingID.isInCombat() && killingID.isValid()
					&& getNPC() == null && !alching && !pickup && killing
					&& !spiritual) {
				if (tileOnScreen(killingID.getLocation())) {
					if (clickCharacterCustom(killingID, "Attack Aviansie")) {
						log("Attacked Aviansie");
						tries++;
						killing = true;
						newTarget = null;
						wait(random(getSI("AttackInt1")[0],
								getSI("AttackInt1")[1]));
					}
				} else {
					if (distanceTo(killingID.getLocation()) < 18) {
						walkTileMM(randomizeTile(killingID.getLocation(), 2, 2));
					}
				}
			}
		} else {
			newNPC = true;
		}

		return random(500, 900);
	}

	public void newHP() {
		eat = random(eatRange[0], eatRange[1]);
		log("Next eating at: " + eat + " HP");
	}

	public void newPotionRange(final boolean flag) {
		final String type = flag == true ? "Range" : "Defence";
		double range = skills.getRealSkillLevel(Skills
				.getStatIndex(flag == true ? "range" : "defence"));
		range = range + Math.round(range * .15 / 2);
		potionRanges[flag == true ? 0 : 1] = (int) range;
		log("Next drinking a " + type + " potion at: " + (int) range + " "
				+ type);
	}

	@Override
	public void onFinish() { // also reset variables
		show = false;
		loot = 0;
		log("avianPro has been ended.");
	}

	public void onRepaint(final Graphics g) {

		if (repaint == 0 || repaint < 21) {
			repaint++;
		}

		if (repaint > 19) {
			repaint = 0;
			if (goalLogout) {
				if (percentGoal >= 100) {
					freezeScript = true;
					goalLogout = false;
					timeToLogGoal = true;
				}
			}

			if (runEnabled) {
				if (hours >= runHours && minutes >= runMinutes) {
					freezeScript = true;
					runEnabled = false;
					timeToLogRun = true;
				}
			}

			if (antiBan[0][0] == 1) {
				if (antiBan[0][4] > 0) {
					antiBan[0][4]--;
				}

				if (antiBan[0][4] < 1 && antiBanSupport[0] == 0) {
					freezeScript = true;
					antiBanSupport[0] = 1;
				}
			}
			if (antiBan[1][0] == 1) {
				if (antiBan[1][3] > 0) {
					antiBan[1][3]--;
				}

				if (antiBan[1][3] < 1 && antiBanSupport[1] == 0) {
					freezeScript = true;
					antiBanSupport[1] = 1;
				}
			}
		}

		if (show) {
			long millis = System.currentTimeMillis() - start;
			hours = millis / (1000 * 60 * 60);
			millis -= hours * 1000 * 60 * 60;
			minutes = millis / (1000 * 60);
			millis -= minutes * 1000 * 60;
			final long seconds = millis / 1000;
			final double currentGold = Math.round(getProfit() / 1000);
			percentGoal = Math.round(100 * currentGold / goal);
			double percentGoalBar = Math.round(170 * currentGold / goal);

			g.setColor(new Color(0, 0, 0, 90));
			g.fill3DRect(5, 60, 303, 274, true);

			if (goal > 0) {
				g.setColor(Color.black);
				if (percentGoal > 100) {
					percentGoal = 100;
				}
				if (percentGoalBar > 170) {
					percentGoalBar = 170;
				}
				g.fill3DRect(9, 243, (int) percentGoalBar, 20, true);
				g.setColor(Color.yellow);
				g.drawString("Goal: " + (int) currentGold + "k/" + goal + "k; "
						+ (int) percentGoal + " %", 17, 257);
			}
			g.setColor(Color.red);
			final Font f1 = new Font("Serif", Font.BOLD, 15);
			final Font f2 = new Font("DialogInput", Font.PLAIN, 12);
			g.setFont(f1);
			g.drawString(getName() + " v" + getVersion() + " by Hidendra", 57,
					73);
			g.setFont(f2);
			g.setColor(Color.green);
			g.drawString("Profit made:  " + getProfit(), 9, 93);
			if (prayer) {
				g.drawString("Profit made-PrayerPotionPrices:  "
						+ getProfitPrayer(), 9, 106);
			}
			g.drawString("Approx Profit/hour:  " + (int) gpHour(), 9, 119);
			g.drawString(
					"Range xp gained: "
							+ (skills.getCurrentSkillExp(Skills
									.getStatIndex("range")) - startxp), 9, 132);
			g.drawString("Approx xp/hour: " + (int) xpHour(), 9, 145);
			g.drawString("KillMode: "
					+ (prayer == true ? "Praying" : "Tanking"), 9, 158);
			g.drawString("Aviansie HP Percent: "
					+ (getNPC() != null ? getNPC().getHPPercent() + "%"
							: "Not in combat."), 9, 171);
			g.drawString("Time running: " + hours + " hours " + minutes
					+ " minutes " + seconds + " seconds", 9, 325);
			if (skills.getRealSkillLevel(Skills.getStatIndex("range")) < 99) {
				g.drawString("Percent until "
						+ (skills.getRealSkillLevel(Skills
								.getStatIndex("range")) + 1) + " Ranged:", 17,
						283);
				g.setColor(Color.red);
				g.fill3DRect(9, 290, 100 - skills.getPercentToNextLevel(Skills
						.getStatIndex("range")), 17, true);
				g.setColor(Color.cyan);
				g.drawString(100
						- skills.getPercentToNextLevel(Skills
								.getStatIndex("range")) + " %", 17, 302);
			}
		}
	}

	@Override
	public boolean onStart(final Map<String, String> args) {
		log("Starting Hidendra's " + getName() + " v" + getVersion());
		Bot.getEventManager().registerListener(this);
		loadConfiguration();

		conf = new Config(this);
		while (!conf.canContinue()) {
			wait(500);
		}

		log("Loading Grand Exchange prices.");
		gePrices[0] = grandExchange.loadItemInfo(drops[0] - 1).getMarketPrice();
		gePrices[1] = grandExchange.loadItemInfo(drops[5]).getMarketPrice();
		gePrices[2] = grandExchange.loadItemInfo(drops[6]).getMarketPrice();
		for (int i = 0; i < prayerPotions.length; i++) {
			prayerPrice[i] = grandExchange.loadItemInfo(prayerPotions[i])
					.getMarketPrice();
		}
		for (int i = 0; i < prayerPotions.length; i++) {
			prayerStarted[i] = getInventoryCount(prayerPotions[i]);
		}
		if (isLoggedIn()) {
			boltStarted = getBoltID();
			boltQuantity = getEquipmentCount(boltStarted);
			gePrices[3] = grandExchange.loadItemInfo(boltStarted)
					.getMarketPrice();
		}

		if (gePrices[0] == -1) {
			gePrices[0] = 2300;
			log("Unable to get Adamant Bar Market Price. Defaulting to 2300.");
		}
		if (gePrices[1] == -1) {
			gePrices[1] = 275;
			log("Unable to get Blood Rune Market Price. Defaulting to 275.");
		}
		if (gePrices[2] == -1) {
			gePrices[2] = 16;
			log("Unable to get Water Rune Market Price. Defaulting to 16.");
		}

		final int eata = 60;
		int btpa = 16;

		eatRange[0] = Integer.parseInt(conf.jTextField1.getText());
		eatRange[1] = Integer.parseInt(conf.jTextField2.getText());
		teleAt = Integer.parseInt(conf.jTextField3.getText());
		if (teleAt > 30) {
			System.err
					.println("Emergency Tele At is at a high-ish value. Consider lowering it.");
		}

		prayer = conf.jCheckBox13.isSelected();
		prayerRange[0] = Integer.parseInt(conf.jTextField5.getText());
		prayerRange[1] = Integer.parseInt(conf.jTextField6.getText());
		prayAt = Integer.parseInt(conf.jTextField7.getText());
		if (prayer) {
			if (prayerRange[0] >= 0 && prayerRange[0] < 3) {
				System.err
						.println("Prayer range is very low. Consider raising it ( "
								+ prayerRange[0] + ", " + prayerRange[1] + " )");
			}
			if (prayAt > 14) {
				System.err
						.println("Immediate prayer drink is at a high value. ( "
								+ prayAt + " ), consider lowering it.");
			}
		}

		emergencyEat = Integer.parseInt(conf.jTextField39.getText());
		if (emergencyEat <= teleAt) {
			System.err
					.println("Emergency Eat is lower or equal to emergency teleporting!! Highly consider lowering.");
		}

		if (conf.jCheckBox8.isSelected()) {
			antiBan[0][1] = Integer.parseInt(conf.jTextField8.getText());
			antiBan[0][2] = Integer.parseInt(conf.jTextField9.getText());
			antiBan[0][3] = Integer.parseInt(conf.jTextField10.getText());
			antiBan[0][4] = random(antiBan[0][1], antiBan[0][2]) / 500 * 1000 * 30;
			setConfig("pricecheck", "true");
			setConfig("pc1", conf.jTextField8.getText());
			setConfig("pc2", conf.jTextField9.getText());
			setConfig("pcwait", conf.jTextField10.getText());
		} else {
			antiBan[0][0] = 0;
			setConfig("pricecheck", "false");
		}

		if (conf.jCheckBox9.isSelected()) {
			antiBan[1][1] = Integer.parseInt(conf.jTextField11.getText());
			antiBan[1][2] = Integer.parseInt(conf.jTextField12.getText());
			antiBan[1][3] = random(antiBan[1][1], antiBan[1][2]) / 500 * 1000 * 30;
			setConfig("checkxp", "true");
			setConfig("xp1", conf.jTextField11.getText());
			setConfig("xp2", conf.jTextField12.getText());
		} else {
			antiBan[1][0] = 0;
			setConfig("checkxp", "false");
		}

		if (conf.jCheckBox16.isSelected()) {
			goalLogout = true;
			setConfig("logoutgoal", "true");
		} else {
			setConfig("logoutgoal", "false");
		}

		if (conf.jCheckBox17.isSelected()) {
			runEnabled = true;
			runHours = Integer.parseInt(conf.jTextField14.getText());
			runMinutes = Integer.parseInt(conf.jTextField15.getText());
			if (runHours > 12 || runMinutes > 60) {
				log("Invalid option for running for x hours/minutes. Please reconfigure this; defaulting to off.");
				runEnabled = false;
				setConfig("runenabled", "false");
				setConfig("runhours", "2");
				setConfig("runminutes", "0");
			} else {
				setConfig("runenabled", "true");
				setConfig("runhours", runHours + "");
				setConfig("runminutes", runMinutes + "");
			}
		} else {
			setConfig("runenabled", "false");
		}

		goal = Integer.parseInt(conf.jTextField13.getText());
		setConfig("gpgoal", conf.jTextField13.getText());

		btpa = Integer.parseInt(conf.jTextField4.getText());

		int i = 0, i3 = 0;
		final int[] i1 = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };

		if (conf.av69.isSelected()) {
			i1[i] = 6232;
			i++;
			setConfig("69", "true");
		} else {
			setConfig("69", "false");
		}

		if (conf.av71.isSelected()) {
			i1[i] = 6240;
			i++;
			setConfig("71", "true");
		} else {
			setConfig("71", "false");
		}

		if (conf.av73.isSelected()) {
			i1[i] = 6241;
			i++;
			setConfig("73", "true");
		} else {
			setConfig("73", "false");
		}

		if (conf.av79.isSelected()) {
			i1[i] = 6233;
			i++;
			setConfig("79", "true");
		} else {
			setConfig("79", "false");
		}

		if (conf.av84.isSelected()) {
			i1[i] = 6234;
			i++;
			setConfig("84", "true");
		} else {
			setConfig("84", "false");
		}

		if (conf.av92.isSelected()) {
			i1[i] = 6236;
			i++;
			setConfig("92", "true");
		} else {
			setConfig("92", "false");
		}

		if (conf.av94.isSelected()) {
			i1[i] = 6244;
			i++;
			setConfig("94", "true");
		} else {
			setConfig("94", "false");
		}

		if (conf.av97.isSelected()) {
			i1[i] = 6245;
			i++;
			setConfig("97", "true");
		} else {
			setConfig("97", "false");
		}

		if (conf.av137.isSelected()) {
			i1[i] = 6238;
			i++;
			setConfig("137", "true");
		} else {
			setConfig("137", "false");
		}

		if (conf.av148.isSelected()) {
			i1[i] = 6239;
			i++;
			setConfig("148", "true");
		} else {
			setConfig("148", "false");
		}

		for (final int element : i1) {
			if (element != -1) {
				i3++;
			}
		}

		if (i3 > 0) {
			aviansies = new int[i3];
		}
		for (int i2 = 0; i2 < i1.length; i2++) {
			if (i1[i2] != -1) {
				aviansies[i2] = i1[i2];
			}
		}

		if (eata > 0 && eata < 100) {
			eat = eata;
		}
		if (eata > 99) {
			log("Eat option too large. Defaulting to 60.");
			eat = 60;
		}

		if (btpa > 0 && btpa < 29) {
			btp = btpa;
		}
		if (btpa > 29) {
			log("Bones to Peaches option too large. Defaulting to 16.");
			btp = 16;
		}

		bury = conf.jCheckBox2.isSelected();
		potions = conf.jCheckBox3.isSelected();
		swordfish1 = conf.jCheckBox7.isSelected();
		waters1 = conf.jCheckBox9.isSelected();
		bloods1 = conf.jCheckBox8.isSelected();
		bolts1 = conf.jCheckBox5.isSelected();
		laws1 = conf.jCheckBox11.isSelected();
		airs1 = conf.jCheckBox10.isSelected();
		clueScroll = conf.jCheckBox6.isSelected();
		ranarrs = conf.jCheckBox12.isSelected();
		chaos = conf.jCheckBox14.isSelected();
		boltPriority = conf.boltSlider.getValue();

		if (conf.jCheckBox4.isSelected()) {
			setConfig("paint", "true");
			show = true;
		} else {
			setConfig("paint", "false");
			show = false;
		}

		if (conf.jCheckBox1.isSelected()) {
			setConfig("alch", "true");
			alch = 1;
		} else {
			setConfig("alch", "false");
			alch = 0;
		}

		setConfig("boltpri", boltPriority + "");
		setConfig("btp", btpa + "");
		setConfig("eatr1", eatRange[0] + "");
		setConfig("eatr2", eatRange[1] + "");
		setConfig("teleat", teleAt + "");
		setConfig("prayat", prayAt + "");
		setConfig("prayr1", prayerRange[0] + "");
		setConfig("prayr2", prayerRange[1] + "");
		setConfig("emereat", emergencyEat + "");

		setConfig("chaos", chaos == true ? "true" : "false");
		setConfig("ranarrs", ranarrs == true ? "true" : "false");
		setConfig("bury", bury == true ? "true" : "false");
		setConfig("prayer", prayer == true ? "true" : "false");
		setConfig("potions", potions == true ? "true" : "false");
		setConfig("swordfish", swordfish1 == true ? "true" : "false");
		setConfig("waters", waters1 == true ? "true" : "false");
		setConfig("bloods", bloods1 == true ? "true" : "false");
		setConfig("bolts", bolts1 == true ? "true" : "false");
		setConfig("laws", laws1 == true ? "true" : "false");
		setConfig("airs", airs1 == true ? "true" : "false");
		setConfig("clue", clueScroll == true ? "true" : "false");

		setConfigCust("CameraInt1", conf.jTextField16.getText());
		setConfigCust("EnableRunInt1", conf.jTextField17.getText());
		setConfigCust("DrinkInt1", conf.jTextField18.getText());
		setConfigCust("DropsInt1", conf.jTextField20.getText());
		setConfigCust("DropsInt2", conf.jTextField19.getText());
		setConfigCust("AttackInt1", conf.jTextField21.getText());
		setConfigCust("SpiritualInt1", conf.jTextField23.getText());
		setConfigCust("Kree'ArraInt1", conf.jTextField22.getText());
		setConfigCust("CheckExpWaitInt1", conf.jTextField24.getText());
		setConfigCust("FoodInt1", conf.jTextField26.getText());
		setConfigCust("FoodInt2", conf.jTextField25.getText());
		setConfigCust("FoodInt3", conf.jTextField27.getText());
		setConfigCust("BoneInt1", conf.jTextField28.getText());
		setConfigCust("BoneInt2", conf.jTextField29.getText());
		setConfigCust("DropJunkInt1", conf.jTextField36.getText());
		setConfigCust("PrayerInt1", conf.jTextField31.getText());
		setConfigCust("PrayerInt2", conf.jTextField30.getText());
		setConfigCust("PrayerInt3", conf.jTextField32.getText());
		setConfigCust("PotionsInt1", conf.jTextField34.getText());
		setConfigCust("PotionsInt2", conf.jTextField33.getText());
		setConfigCust("AvianHandleWaitInt1", conf.jTextField35.getText());

		saveConfiguration();
		conf = null;

		return true;
	}

	public void openPayPalDonation() {

		if (!java.awt.Desktop.isDesktopSupported()) {
			System.err
					.println("Unable to open PayPal page. You can manually open the page; the url is https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4625597");
			return;
		}
		final java.awt.Desktop desktop = java.awt.Desktop.getDesktop();
		if (!desktop.isSupported(java.awt.Desktop.Action.BROWSE)) {
			System.err
					.println("Unable to open PayPal page. You can manually open the page; the url is https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4625597");
			return;
		}
		try {
			desktop
					.browse(new URI(
							"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4625597"));
			log("Successfully opened Donation page.");
		} catch (final Exception e) {
			e.printStackTrace();
			return;
		}

	}

	private int prayerActivated() { // Author: Velocity
		switch (getSetting(1395)) {
		case 1:
			return 1; // Thick Skin
		case 2:
			return 2; // Burst of Strength
		case 4:
			return 3; // Clarity of Thought
		case 262144:
			return 4; // Sharp Eye
		case 524288:
			return 5; // Mystic Will
		case 8:
			return 6; // Rock Skin
		case 16:
			return 7; // Superhuman Strength
		case 32:
			return 8; // Improved Reflexes
		case 64:
			return 9; // Rapid Restore
		case 128:
			return 10; // Rapid Heal
		case 256:
			return 11; // Protect Item
		case 1048576:
			return 12; // Hawk Eye
		case 2097152:
			return 13; // Mystic Lore
		case 512:
			return 14; // Steel Skin
		case 1024:
			return 15; // Ultimate Strength
		case 2048:
			return 16; // Incredible Reflexes
		case 16777216:
			return 17; // Protect from Summoning
		case 4096:
			return 18; // Protect from Magic
		case 8192:
			return 19; // Protect from Range
		case 16384:
			return 20; // Protect from Melee
		case 4194304:
			return 21; // Eagle Eye
		case 8388608:
			return 22; // Mystic Might
		case 32768:
			return 23; // Retribution
		case 65536:
			return 24; // Redemption
		case 131072:
			return 25; // Smite
		case 3:
			return 26; // Chivalry (Need Info)
		case 6:
			return 27; // Piety (Need Info)
		default:
			return 0; // None Activated
		}
	}

	private int prayerPotionCount() {
		int i = 0;
		final int[] items = getInventoryArray();
		for (final int i1 : items) {
			for (final int i2 : prayerPotions) {
				if (i1 == i2) {
					i++;
				}
			}
		}
		return i;
	}

	private int prayerPotionItem() {
		final int[] items = getInventoryArray();
		for (final int i : prayerPotions) {
			for (final int i1 : items) {
				if (i == i1) {
					return i;
				}
			}
		}
		return -1;
	}

	public void priceChecker() {
		if (getCurrentTab() != Constants.TAB_EQUIPMENT) {
			openTab(Constants.TAB_EQUIPMENT);
		}
		// atInterface(387, 81);
		moveMouse(random(624, 660), random(414, 450));
		clickMouse(true);
		while (!RSInterface.getInterface(206).isValid()) {
			wait(50);
		}
		final int[] items = getInventoryArray();
		final int[] add = { drops[0], 995, drops[5], drops[6], 556, 563 };
		for (final int i : items) {
			for (final int i1 : add) {
				if (i1 == i) {
					atPriceChecker(i1);
					wait(random(100, 1000));
				}
			}
		}
		wait(random((int) antiBan[0][3] * 1000 - 250,
				(int) antiBan[0][3] * 100 + 1500));
		moveMouse(random(481, 491), random(28, 40));
		wait(random(50, 500));
		clickMouse(true);
		freezeScript = false;
		antiBan[0][4] = random(antiBan[0][1], antiBan[0][2]) / 500 * 1000 * 30;
	}

	private int rangePotionCount() {
		int i = 0;
		final int[] items = getInventoryArray();
		for (final int i1 : items) {
			for (final int i2 : rangePotions) {
				if (i1 == i2) {
					i++;
				}
			}
		}
		return i;
	}

	private int rangePotionItem() {
		final int[] items = getInventoryArray();
		for (final int i : items) {
			for (final int i1 : rangePotions) {
				if (i == i1) {
					return i1;
				}
			}
		}
		return -1;
	}

	private boolean rangePrayerActivated() {
		if (Integer.toString(prayerActivated()).contains("19")) {
			return true;
		}
		return false;
	}

	private void saveConfiguration() {
		try {
			final File conf = new File("Settings/avianProConfig.txt");
			conf.delete();
			conf.createNewFile();
			final BufferedWriter out = new BufferedWriter(new FileWriter(
					"Settings/avianProConfig.txt"));
			if (config[0] == null) {
				loadDefaultConfig();
			}
			for (final String x : config) {
				if (x == null) {
					continue;
				}
				out.write(x);
				out.newLine();
			}
			out.close();
		} catch (final IOException e) {
		}
	}

	public void serverMessageRecieved(final ServerMessageEvent arg) {
		if (arg.getMessage().equalsIgnoreCase(
				"There is no ammo left in your quiver.")) {
			log("Uh oh, we're out of ammo. Breaking tablet and quitting.");
			getOut(true);
		}

		if (arg
				.getMessage()
				.equalsIgnoreCase(
						"You need a higher slayer level to know how to wound this monster.")) {
			spiritual = true;
		}

		if (arg.getMessage().contains("out of Prayer points")) {
			log("We ran out of Prayer Points.");
			if (prayerPotionCount() == 0) {
				log("No prayer potions are left. Teleporting now.");
				getOut(true);
			} else {
				log("There are still "
						+ prayerPotionCount()
						+ " Prayer Potions left... Lets sip a dose and reactivate prayer.");
				clickInventoryItem(prayerPotionItem(), true);
				wait(random(getSI("DrinkInt1")[0], getSI("DrinkInt1")[1]));
				activatePrayer();
			}
		}

		if (arg.getMessage().contains("recharge your Prayer")) {
			log("We are trying to activate prayer but no prayer is left?");
			if (prayerPotionCount() == 0) {
				log("No prayer potions are left. Teleporting now.");
				getOut(true);
			} else {
				log("There are still "
						+ prayerPotionCount()
						+ " Prayer Potions left... Lets sip a dose and reactivate prayer.");
				clickInventoryItem(prayerPotionItem(), true);
				wait(random(getSI("DrinkInt1")[0], getSI("DrinkInt1")[1]));
				activatePrayer();
			}
		}

		if (arg.getMessage().contains("door devours the life-force")) {
			log("Oh dear... Looks like we've got a date with Kree'arra herself.....");
			log(".....      I think it'd be best if we skipped the date.");
			clickInventoryItem(getTeleportID(), true);
			wait(random(15000, 20000));
			stopAllScripts();
		}
	}

	public void setConfig(final String index, final String value) {
		for (int i = 0; i < config.length; i++) {
			if (config[i] == null) {
				continue;
			}
			final String x1[] = config[i].split(":");
			if (x1[0].equals(index)) {
				config[i] = index + ":" + value;
				return;
			}
		}
		for (int i = 0; i < config.length; i++) {
			if (config[i] == null) {
				config[i] = index + ":" + value;
				break;
			}
		}
	}

	public void setConfigCust(final String index, final String value) {
		for (int i = 0; i < config.length; i++) {
			if (config[i] == null) {
				continue;
			}
			final String x1[] = config[i].split(":");
			if (x1[0].equals(index)) {
				config[i] = index + ":" + value;
				return;
			}
		}
		for (int i = 0; i < config.length; i++) {
			if (config[i] == null) {
				config[i] = index + ":" + value;
				break;
			}
		}
	}

	public void teleport(final String message) {
		log(message);
		clickInventoryItem(getTeleportID(), true);
		wait(random(getSI("Kree'ArraInt1")[0], getSI("Kree'ArraInt1")[1]));
		stopAllScripts();
	}

	private boolean turnPrayer(final int prayID, final boolean activate) {
		final int cPrayer = prayerActivated();
		if (activate) {
			if (cPrayer == prayID) {
				return true;
			}
			clickPrayer(prayID);
			wait(random(500, 750));
			return prayerActivated() == prayID;
		} else {
			if (cPrayer == 0) {
				return true;
			}
			clickPrayer(prayID);
			wait(random(500, 750));
			return prayerActivated() == 0;
		}
	}

	@Override
	public void wait(final int toSleep) { // i doubt this'll get added to RSBot
		// so
		// using my method of sleeping
		final long start = System.currentTimeMillis() + toSleep;
		while (true) {
			if (System.currentTimeMillis() - start > 0) {
				break;
			}
		}
	}

	private double xpHour() {
		final double hours1 = (double) hours;
		double minutes1 = (double) minutes;
		if (minutes1 == 0 && hours1 == 0) {
			return 0;
		}
		if (hours1 > 0) {
			minutes1 = minutes1 + hours1 * 60;
		}
		return Math.round((skills.getCurrentSkillExp(Skills
				.getStatIndex("range")) - startxp)
				* 60 / minutes1);
	}

}
